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

Side by Side Diff: chrome/browser/ui/webui/favicon_source.cc

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 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 (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/ui/webui/favicon_source.h" 5 #include "chrome/browser/ui/webui/favicon_source.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 std::string FaviconSource::GetSource() const { 57 std::string FaviconSource::GetSource() const {
58 return icon_types_ == favicon_base::FAVICON ? chrome::kChromeUIFaviconHost 58 return icon_types_ == favicon_base::FAVICON ? chrome::kChromeUIFaviconHost
59 : chrome::kChromeUITouchIconHost; 59 : chrome::kChromeUITouchIconHost;
60 } 60 }
61 61
62 void FaviconSource::StartDataRequest( 62 void FaviconSource::StartDataRequest(
63 const std::string& path, 63 const std::string& path,
64 int render_process_id, 64 int render_process_id,
65 int render_frame_id, 65 int render_frame_id,
66 const content::URLDataSource::GotDataCallback& callback) { 66 const content::URLDataSource::GotDataCallback& callback) {
67 FaviconService* favicon_service = 67 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
68 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); 68 profile_, ServiceAccessType::EXPLICIT_ACCESS);
69 if (!favicon_service) { 69 if (!favicon_service) {
70 SendDefaultResponse(callback); 70 SendDefaultResponse(callback);
71 return; 71 return;
72 } 72 }
73 73
74 chrome::ParsedFaviconPath parsed; 74 chrome::ParsedFaviconPath parsed;
75 bool success = chrome::ParseFaviconPath(path, icon_types_, &parsed); 75 bool success = chrome::ParseFaviconPath(path, icon_types_, &parsed);
76 if (!success) { 76 if (!success) {
77 SendDefaultResponse(callback); 77 SendDefaultResponse(callback);
78 return; 78 return;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 ui::ScaleFactor resource_scale_factor = 198 ui::ScaleFactor resource_scale_factor =
199 ui::GetSupportedScaleFactor(icon_request.device_scale_factor); 199 ui::GetSupportedScaleFactor(icon_request.device_scale_factor);
200 default_favicon = 200 default_favicon =
201 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 201 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
202 resource_id, resource_scale_factor); 202 resource_id, resource_scale_factor);
203 default_favicons_[favicon_index] = default_favicon; 203 default_favicons_[favicon_index] = default_favicon;
204 } 204 }
205 205
206 icon_request.callback.Run(default_favicon); 206 icon_request.callback.Run(default_favicon);
207 } 207 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_icon_source.cc ('k') | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698