OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/webui/web_ui_factory.h" | 5 #include "content/browser/webui/web_ui_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/about_flags.h" | 8 #include "chrome/browser/about_flags.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // part of the manifest. | 288 // part of the manifest. |
289 if (page_url.SchemeIs(chrome::kExtensionScheme) && | 289 if (page_url.SchemeIs(chrome::kExtensionScheme) && |
290 page_url.host() != extension_misc::kBookmarkManagerId) { | 290 page_url.host() != extension_misc::kBookmarkManagerId) { |
291 ExtensionWebUI::GetFaviconForURL(profile, request, page_url); | 291 ExtensionWebUI::GetFaviconForURL(profile, request, page_url); |
292 } else { | 292 } else { |
293 scoped_refptr<RefCountedMemory> icon_data( | 293 scoped_refptr<RefCountedMemory> icon_data( |
294 WebUIFactory::GetFaviconResourceBytes(profile, page_url)); | 294 WebUIFactory::GetFaviconResourceBytes(profile, page_url)); |
295 bool know_icon = icon_data.get() != NULL && icon_data->size() > 0; | 295 bool know_icon = icon_data.get() != NULL && icon_data->size() > 0; |
296 request->ForwardResultAsync( | 296 request->ForwardResultAsync( |
297 FaviconService::FaviconDataCallback::TupleType(request->handle(), | 297 FaviconService::FaviconDataCallback::TupleType(request->handle(), |
298 know_icon, icon_data, false, GURL())); | 298 know_icon, icon_data, false, GURL(), history::FAV_ICON)); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 // static | 302 // static |
303 RefCountedMemory* WebUIFactory::GetFaviconResourceBytes(Profile* profile, | 303 RefCountedMemory* WebUIFactory::GetFaviconResourceBytes(Profile* profile, |
304 const GURL& page_url) { | 304 const GURL& page_url) { |
305 // The bookmark manager is a chrome extension, so we have to check for it | 305 // The bookmark manager is a chrome extension, so we have to check for it |
306 // before we check for extension scheme. | 306 // before we check for extension scheme. |
307 if (page_url.host() == extension_misc::kBookmarkManagerId) | 307 if (page_url.host() == extension_misc::kBookmarkManagerId) |
308 return BookmarksUI::GetFaviconResourceBytes(); | 308 return BookmarksUI::GetFaviconResourceBytes(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 if (page_url.host() == chrome::kChromeUIPluginsHost) | 345 if (page_url.host() == chrome::kChromeUIPluginsHost) |
346 return PluginsUI::GetFaviconResourceBytes(); | 346 return PluginsUI::GetFaviconResourceBytes(); |
347 | 347 |
348 #if defined(ENABLE_REMOTING) | 348 #if defined(ENABLE_REMOTING) |
349 if (page_url.host() == chrome::kChromeUIRemotingHost) | 349 if (page_url.host() == chrome::kChromeUIRemotingHost) |
350 return RemotingUI::GetFaviconResourceBytes(); | 350 return RemotingUI::GetFaviconResourceBytes(); |
351 #endif | 351 #endif |
352 | 352 |
353 return NULL; | 353 return NULL; |
354 } | 354 } |
OLD | NEW |