OLD | NEW |
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 #include "chrome/browser/favicon/favicon_service.h" | 5 #include "chrome/browser/favicon/favicon_service.h" |
6 | 6 |
7 #include "chrome/browser/history/history.h" | 7 #include "chrome/browser/history/history.h" |
8 #include "chrome/browser/history/history_backend.h" | 8 #include "chrome/browser/history/history_backend.h" |
9 #include "chrome/browser/history/history_service_factory.h" | 9 #include "chrome/browser/history/history_service_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 FaviconService::Handle FaviconService::GetFaviconForURL( | 56 FaviconService::Handle FaviconService::GetFaviconForURL( |
57 const GURL& page_url, | 57 const GURL& page_url, |
58 int icon_types, | 58 int icon_types, |
59 CancelableRequestConsumerBase* consumer, | 59 CancelableRequestConsumerBase* consumer, |
60 const FaviconDataCallback& callback) { | 60 const FaviconDataCallback& callback) { |
61 GetFaviconRequest* request = new GetFaviconRequest(callback); | 61 GetFaviconRequest* request = new GetFaviconRequest(callback); |
62 AddRequest(request, consumer); | 62 AddRequest(request, consumer); |
63 FaviconService::Handle handle = request->handle(); | 63 FaviconService::Handle handle = request->handle(); |
64 if (page_url.SchemeIs(chrome::kChromeUIScheme) || | 64 if (page_url.SchemeIs(chrome::kChromeUIScheme) || |
65 page_url.SchemeIs(chrome::kExtensionScheme)) { | 65 page_url.SchemeIs(chrome::kExtensionScheme)) { |
| 66 // XXX webui |
66 ChromeWebUIControllerFactory::GetInstance()->GetFaviconForURL( | 67 ChromeWebUIControllerFactory::GetInstance()->GetFaviconForURL( |
67 profile_, request, page_url); | 68 profile_, request, page_url); |
68 } else { | 69 } else { |
69 HistoryService* hs = HistoryServiceFactory::GetForProfile( | 70 HistoryService* hs = HistoryServiceFactory::GetForProfile( |
70 profile_, Profile::EXPLICIT_ACCESS); | 71 profile_, Profile::EXPLICIT_ACCESS); |
71 if (hs) { | 72 if (hs) { |
72 gfx::Size default_icon_size(gfx::kFaviconSize, gfx::kFaviconSize); | 73 gfx::Size default_icon_size(gfx::kFaviconSize, gfx::kFaviconSize); |
73 hs->GetFaviconForURL(request, page_url, default_icon_size, icon_types); | 74 hs->GetFaviconForURL(request, page_url, default_icon_size, icon_types); |
74 } else { | 75 } else { |
75 ForwardEmptyResultAsync(request); | 76 ForwardEmptyResultAsync(request); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 hs->SetFavicon(page_url, icon_url, image_data, default_icon_size, icon_type)
; | 134 hs->SetFavicon(page_url, icon_url, image_data, default_icon_size, icon_type)
; |
134 } | 135 } |
135 } | 136 } |
136 | 137 |
137 FaviconService::~FaviconService() { | 138 FaviconService::~FaviconService() { |
138 } | 139 } |
139 | 140 |
140 void FaviconService::ForwardEmptyResultAsync(GetFaviconRequest* request) { | 141 void FaviconService::ForwardEmptyResultAsync(GetFaviconRequest* request) { |
141 request->ForwardResultAsync(request->handle(), history::FaviconData()); | 142 request->ForwardResultAsync(request->handle(), history::FaviconData()); |
142 } | 143 } |
OLD | NEW |