Roll ANGLE cc54ab3..c5b2ba5
[chromium-blink-merge.git] / components / favicon / core / favicon_client.h
blob71dce4ef5e0226f3f7ed3b0940a9b92dae651ccd
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_CLIENT_H_
6 #define COMPONENTS_FAVICON_CORE_FAVICON_CLIENT_H_
8 #include <vector>
10 #include "base/macros.h"
11 #include "base/task/cancelable_task_tracker.h"
12 #include "components/favicon_base/favicon_callback.h"
14 class GURL;
16 namespace favicon {
18 // This class abstracts operations that depend on the embedder's environment,
19 // e.g. Chrome.
20 class FaviconClient {
21 public:
22 FaviconClient() {}
23 virtual ~FaviconClient() {}
25 // Returns true if the specified URL is a native application page URL.
26 // If this returns true the favicon for the page must be fetched using
27 // GetFaviconForNativeApplicationURL().
28 virtual bool IsNativeApplicationURL(const GURL& url) = 0;
30 // Requests the favicon for a native application page URL for the sizes
31 // specified by |desired_sizes_in_pixel|. Returns a TaskId to use to cancel
32 // the request using |tracker| or kBadTaskId if the request cannot be
33 // scheduled. |callback| will be called with the favicon results.
34 virtual base::CancelableTaskTracker::TaskId GetFaviconForNativeApplicationURL(
35 const GURL& url,
36 const std::vector<int>& desired_sizes_in_pixel,
37 const favicon_base::FaviconResultsCallback& callback,
38 base::CancelableTaskTracker* tracker) = 0;
40 private:
41 DISALLOW_COPY_AND_ASSIGN(FaviconClient);
44 } // namespace favicon
46 #endif // COMPONENTS_FAVICON_CORE_FAVICON_CLIENT_H_