// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_CHROME_BROWSER_READING_LIST_UI_BUNDLED_READING_LIST_UTILS_H_
#define IOS_CHROME_BROWSER_READING_LIST_UI_BUNDLED_READING_LIST_UTILS_H_

class ReadingListBrowserAgent;
namespace web {
class WebState;
}  // namespace web

namespace reading_list {

// Adds `web_state` visible or canonical URL to reading list using
// `readingListBrowserAgent`. This function retrieves the canonical URL
// asynchronously first, and post the request when the result is fetched. It
// does nothing if the `readingListBrowserAgent` or the `web_state` are
// destroyed before the URL can be added to the list.
void AddToReadingListUsingCanonicalUrl(
    ReadingListBrowserAgent* readingListBrowserAgent,
    web::WebState* web_state);

}  // namespace reading_list

#endif  // IOS_CHROME_BROWSER_READING_LIST_UI_BUNDLED_READING_LIST_UTILS_H_
