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

Side by Side Diff: chrome/browser/ui/webui/large_icon_source.h

Issue 1092873002: [Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to f… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_UI_WEBUI_LARGE_ICON_SOURCE_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
6 #define CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ 6 #define CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
huangs 2015/04/17 03:55:17 Can move #include <vector> to the .cc file.
beaudoin 2015/04/17 14:50:52 Done.
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/task/cancelable_task_tracker.h" 12 #include "base/task/cancelable_task_tracker.h"
13 #include "components/favicon/core/fallback_icon_service.h" 13 #include "components/favicon/core/fallback_icon_service.h"
14 #include "components/favicon_base/favicon_types.h" 14 #include "components/favicon_base/favicon_types.h"
15 #include "content/public/browser/url_data_source.h" 15 #include "content/public/browser/url_data_source.h"
16 #include "third_party/skia/include/core/SkColor.h" 16 #include "third_party/skia/include/core/SkColor.h"
17 17
18 namespace favicon { 18 namespace favicon {
19 class FallbackIconService; 19 class FallbackIconService;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 content::URLDataSource::GotDataCallback callback; 64 content::URLDataSource::GotDataCallback callback;
65 GURL url; 65 GURL url;
66 int size; 66 int size;
67 }; 67 };
68 68
69 private: 69 private:
70 // Callback for icon data retrieval request. 70 // Callback for icon data retrieval request.
71 void OnIconDataAvailable( 71 void OnIconDataAvailable(
72 const IconRequest& request, 72 const IconRequest& request,
73 const favicon_base::FaviconRawBitmapResult& bitmap_result); 73 const favicon_base::LargeIconResult& bitmap_result);
74 74
75 // Renders and sends a default fallback icon. This is used when there is no 75 // Renders and sends a default fallback icon. This is used when there is no
76 // known text and/or foreground color to use for the generated icon (it 76 // known text and/or foreground color to use for the generated icon (it
77 // defaults to a light text color on a dark gray background). 77 // defaults to a light text color on a dark gray background).
78 void SendDefaultFallbackIcon(const IconRequest& request); 78 void SendDefaultFallbackIcon(const IconRequest& request);
79 79
80 // Renders and sends a fallback icon using the given colors. 80 // Renders and sends a fallback icon using the given colors.
81 void SendFallbackIcon(const IconRequest& request, 81 void SendFallbackIcon(const IconRequest& request,
82 SkColor text_color, 82 SkColor text_color,
83 SkColor background_color); 83 SkColor background_color);
84 84
85 // Returns null to trigger "Not Found" response. 85 // Returns null to trigger "Not Found" response.
86 void SendNotFoundResponse( 86 void SendNotFoundResponse(
87 const content::URLDataSource::GotDataCallback& callback); 87 const content::URLDataSource::GotDataCallback& callback);
88 88
89 base::CancelableTaskTracker cancelable_task_tracker_; 89 base::CancelableTaskTracker cancelable_task_tracker_;
90 90
91 favicon::FaviconService* favicon_service_; 91 favicon::FaviconService* favicon_service_;
92 92
93 favicon::FallbackIconService* fallback_icon_service_; 93 favicon::FallbackIconService* fallback_icon_service_;
94 94
95 // A pre-populated list of the types of icon files to consider when looking
96 // for the largest matching icon.
97 // Note: this is simply an optimization over populating an icon type vector
98 // on each request.
99 std::vector<int> large_icon_types_;
100
101 DISALLOW_COPY_AND_ASSIGN(LargeIconSource); 95 DISALLOW_COPY_AND_ASSIGN(LargeIconSource);
102 }; 96 };
103 97
104 #endif // CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ 98 #endif // CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/large_icon_source.cc » ('j') | chrome/browser/ui/webui/large_icon_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698