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

Side by Side Diff: chrome/browser/task_management/providers/web_contents/renderer_task.cc

Issue 1407353012: Refactor FaviconDriver::OnFaviconAvailable() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@initial_simplify
Patch Set: Created 5 years 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 #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" 5 #include "chrome/browser/task_management/providers/web_contents/renderer_task.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/numerics/safe_conversions.h" 8 #include "base/numerics/safe_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 bool RendererTask::ReportsWebCacheStats() const { 141 bool RendererTask::ReportsWebCacheStats() const {
142 return true; 142 return true;
143 } 143 }
144 144
145 blink::WebCache::ResourceTypeStats RendererTask::GetWebCacheStats() const { 145 blink::WebCache::ResourceTypeStats RendererTask::GetWebCacheStats() const {
146 return webcache_stats_; 146 return webcache_stats_;
147 } 147 }
148 148
149 void RendererTask::OnFaviconAvailable(const gfx::Image& image) {
150 }
151
152 void RendererTask::OnFaviconUpdated(favicon::FaviconDriver* favicon_driver, 149 void RendererTask::OnFaviconUpdated(favicon::FaviconDriver* favicon_driver,
153 bool icon_url_changed) { 150 NotificationIconType notification_icon_type,
154 UpdateFavicon(); 151 const GURL& icon_url,
152 bool icon_url_changed,
153 const gfx::Image& image) {
154 if (notification_icon_type == NON_TOUCH_16_DIP)
155 UpdateFavicon();
155 } 156 }
156 157
157 // static 158 // static
158 base::string16 RendererTask::GetTitleFromWebContents( 159 base::string16 RendererTask::GetTitleFromWebContents(
159 content::WebContents* web_contents) { 160 content::WebContents* web_contents) {
160 DCHECK(web_contents); 161 DCHECK(web_contents);
161 base::string16 title = web_contents->GetTitle(); 162 base::string16 title = web_contents->GetTitle();
162 if (title.empty()) { 163 if (title.empty()) {
163 GURL url = web_contents->GetURL(); 164 GURL url = web_contents->GetURL();
164 title = base::UTF8ToUTF16(url.spec()); 165 title = base::UTF8ToUTF16(url.spec());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 if (is_incognito) 219 if (is_incognito)
219 message_id = IDS_TASK_MANAGER_EXTENSION_INCOGNITO_PREFIX; 220 message_id = IDS_TASK_MANAGER_EXTENSION_INCOGNITO_PREFIX;
220 else 221 else
221 message_id = IDS_TASK_MANAGER_EXTENSION_PREFIX; 222 message_id = IDS_TASK_MANAGER_EXTENSION_PREFIX;
222 } 223 }
223 224
224 return l10n_util::GetStringFUTF16(message_id, title); 225 return l10n_util::GetStringFUTF16(message_id, title);
225 } 226 }
226 227
227 } // namespace task_management 228 } // namespace task_management
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698