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

Side by Side Diff: chrome/browser/favicon/favicon_handler.h

Issue 987113005: Refactor favicon to use C++11 loop and fix style violation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@favicon_client
Patch Set: Rebase Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_
6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ 6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // 69 //
70 // When the renderer downloads favicons, it considers the entire list of 70 // When the renderer downloads favicons, it considers the entire list of
71 // favicon candidates, if |download_largest_favicon_| is true, the largest 71 // favicon candidates, if |download_largest_favicon_| is true, the largest
72 // favicon will be used, otherwise the one that best matches the preferred size 72 // favicon will be used, otherwise the one that best matches the preferred size
73 // is chosen (or the first one if there is no preferred size). Once the 73 // is chosen (or the first one if there is no preferred size). Once the
74 // matching favicon has been determined, SetFavicon is called which updates 74 // matching favicon has been determined, SetFavicon is called which updates
75 // the page's favicon and notifies the database to save the favicon. 75 // the page's favicon and notifies the database to save the favicon.
76 76
77 class FaviconHandler { 77 class FaviconHandler {
78 public: 78 public:
79 enum Type { 79 enum Type { FAVICON, TOUCH };
80 FAVICON,
81 TOUCH,
82 };
83 80
84 FaviconHandler(FaviconService* service, 81 FaviconHandler(FaviconService* service,
85 FaviconClient* client, 82 FaviconClient* client,
86 FaviconDriver* driver, 83 FaviconDriver* driver,
87 Type icon_type, 84 Type icon_type,
88 bool download_largest_icon); 85 bool download_largest_icon);
89 virtual ~FaviconHandler(); 86 virtual ~FaviconHandler();
90 87
91 // Initiates loading the favicon for the specified url. 88 // Initiates loading the favicon for the specified url.
92 void FetchFavicon(const GURL& url); 89 void FetchFavicon(const GURL& url);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Best image we've seen so far. As images are downloaded from the page they 295 // Best image we've seen so far. As images are downloaded from the page they
299 // are stored here. When there is an exact match, or no more images are 296 // are stored here. When there is an exact match, or no more images are
300 // available the favicon service and the current page are updated (assuming 297 // available the favicon service and the current page are updated (assuming
301 // the image is for a favicon). 298 // the image is for a favicon).
302 FaviconCandidate best_favicon_candidate_; 299 FaviconCandidate best_favicon_candidate_;
303 300
304 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); 301 DISALLOW_COPY_AND_ASSIGN(FaviconHandler);
305 }; 302 };
306 303
307 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ 304 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698