Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: components/bookmarks/browser/bookmark_client.h

Issue 331163003: [Refactor] Change FaviconService API to take in a desired pixel size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_
7 7
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 21 matching lines...) Expand all
32 // Types representing a set of BookmarkNode and a mapping from BookmarkNode 32 // Types representing a set of BookmarkNode and a mapping from BookmarkNode
33 // to the number of time the corresponding URL has been typed by the user in 33 // to the number of time the corresponding URL has been typed by the user in
34 // the Omnibox. 34 // the Omnibox.
35 typedef std::set<const BookmarkNode*> NodeSet; 35 typedef std::set<const BookmarkNode*> NodeSet;
36 typedef std::pair<const BookmarkNode*, int> NodeTypedCountPair; 36 typedef std::pair<const BookmarkNode*, int> NodeTypedCountPair;
37 typedef std::vector<NodeTypedCountPair> NodeTypedCountPairs; 37 typedef std::vector<NodeTypedCountPair> NodeTypedCountPairs;
38 38
39 // Returns true if the embedder favors touch icons over favicons. 39 // Returns true if the embedder favors touch icons over favicons.
40 virtual bool PreferTouchIcon(); 40 virtual bool PreferTouchIcon();
41 41
42 // Requests the favicon of any of |icon_types| whose pixel sizes most 42 // Requests a multi-resolution favicon from the history cache of type
43 // closely match |desired_size_in_dip| (if value is 0, the largest favicon 43 // favicon_base::FAVICON for the web page at |page_url|. The retrieved
44 // is returned) and desired scale factor for |page_url|. |callback| is run 44 // data is resized such that the image passed to |callback| has
45 // when the bits have been fetched. |icon_types| can be any combination of 45 // gfx::kFaviconSize width and height.
46 // IconType value, but only one icon will be returned. 46 // |callback| is run when the favicon has been fetched.
47 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL( 47 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForPageURL(
48 const GURL& page_url, 48 const GURL& page_url,
49 int icon_types,
50 int desired_size_in_dip,
51 const favicon_base::FaviconImageCallback& callback, 49 const favicon_base::FaviconImageCallback& callback,
52 base::CancelableTaskTracker* tracker); 50 base::CancelableTaskTracker* tracker);
53 51
52 // Requests the largest favicon of type favicon_base::TOUCH_ICON in the
sky 2014/07/10 00:03:39 Can we pass in favicon_base::IconType so that we o
pkotwicz 2014/07/11 01:23:08 The main reason that I split the method into two i
sky 2014/07/11 16:26:51 This interface is very narrowly used, so I'm fine
pkotwicz 2014/07/11 18:47:44 Done!
53 // history cache for the web page at |page_url|.
54 // |callback| is run when the favicon has been fetched.
55 virtual base::CancelableTaskTracker::TaskId GetTouchFaviconImageForPageURL(
56 const GURL& page_url,
57 const favicon_base::FaviconImageCallback& callback,
58 base::CancelableTaskTracker* tracker);
59
54 // Returns true if the embedder supports typed count for URL. 60 // Returns true if the embedder supports typed count for URL.
55 virtual bool SupportsTypedCountForNodes(); 61 virtual bool SupportsTypedCountForNodes();
56 62
57 // Retrieves the number of time each BookmarkNode URL has been typed in 63 // Retrieves the number of time each BookmarkNode URL has been typed in
58 // the Omnibox by the user. 64 // the Omnibox by the user.
59 virtual void GetTypedCountForNodes( 65 virtual void GetTypedCountForNodes(
60 const NodeSet& nodes, 66 const NodeSet& nodes,
61 NodeTypedCountPairs* node_typed_count_pairs); 67 NodeTypedCountPairs* node_typed_count_pairs);
62 68
63 // Returns whether the embedder wants permanent node |node| 69 // Returns whether the embedder wants permanent node |node|
(...skipping 20 matching lines...) Expand all
84 // http://crbug.com/49598 90 // http://crbug.com/49598
85 virtual bool CanBeEditedByUser(const BookmarkNode* node) = 0; 91 virtual bool CanBeEditedByUser(const BookmarkNode* node) = 0;
86 92
87 protected: 93 protected:
88 virtual ~BookmarkClient() {} 94 virtual ~BookmarkClient() {}
89 }; 95 };
90 96
91 } // namespace bookmarks 97 } // namespace bookmarks
92 98
93 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ 99 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698