| 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/extensions/extension_web_ui.h" | 5 #include "chrome/browser/extensions/extension_web_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 extensions::BookmarkManagerPrivateEventRouter* | 158 extensions::BookmarkManagerPrivateEventRouter* |
| 159 ExtensionWebUI::bookmark_manager_private_event_router() { | 159 ExtensionWebUI::bookmark_manager_private_event_router() { |
| 160 return bookmark_manager_private_event_router_.get(); | 160 return bookmark_manager_private_event_router_.get(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 //////////////////////////////////////////////////////////////////////////////// | 163 //////////////////////////////////////////////////////////////////////////////// |
| 164 // chrome:// URL overrides | 164 // chrome:// URL overrides |
| 165 | 165 |
| 166 // static | 166 // static |
| 167 void ExtensionWebUI::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 167 void ExtensionWebUI::RegisterUserPrefs( |
| 168 registry->RegisterDictionaryPref(kExtensionURLOverrides, | 168 user_prefs::PrefRegistrySyncable* registry) { |
| 169 PrefRegistrySyncable::UNSYNCABLE_PREF); | 169 registry->RegisterDictionaryPref( |
| 170 kExtensionURLOverrides, |
| 171 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 170 } | 172 } |
| 171 | 173 |
| 172 // static | 174 // static |
| 173 bool ExtensionWebUI::HandleChromeURLOverride( | 175 bool ExtensionWebUI::HandleChromeURLOverride( |
| 174 GURL* url, content::BrowserContext* browser_context) { | 176 GURL* url, content::BrowserContext* browser_context) { |
| 175 if (!url->SchemeIs(chrome::kChromeUIScheme)) | 177 if (!url->SchemeIs(chrome::kChromeUIScheme)) |
| 176 return false; | 178 return false; |
| 177 | 179 |
| 178 Profile* profile = Profile::FromBrowserContext(browser_context); | 180 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 179 const DictionaryValue* overrides = | 181 const DictionaryValue* overrides = |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, | 416 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, |
| 415 gfx::Size(pixel_size, pixel_size), | 417 gfx::Size(pixel_size, pixel_size), |
| 416 scale_factors[i])); | 418 scale_factors[i])); |
| 417 } | 419 } |
| 418 | 420 |
| 419 // LoadImagesAsync actually can run callback synchronously. We want to force | 421 // LoadImagesAsync actually can run callback synchronously. We want to force |
| 420 // async. | 422 // async. |
| 421 extensions::ImageLoader::Get(profile)->LoadImagesAsync( | 423 extensions::ImageLoader::Get(profile)->LoadImagesAsync( |
| 422 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); | 424 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); |
| 423 } | 425 } |
| OLD | NEW |