| 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 "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/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 gfx::NativeView ExtensionWebUI::GetNativeViewOfHost() { | 233 gfx::NativeView ExtensionWebUI::GetNativeViewOfHost() { |
| 234 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); | 234 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); |
| 235 return rwhv ? rwhv->GetNativeView() : NULL; | 235 return rwhv ? rwhv->GetNativeView() : NULL; |
| 236 } | 236 } |
| 237 | 237 |
| 238 //////////////////////////////////////////////////////////////////////////////// | 238 //////////////////////////////////////////////////////////////////////////////// |
| 239 // chrome:// URL overrides | 239 // chrome:// URL overrides |
| 240 | 240 |
| 241 // static | 241 // static |
| 242 void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) { | 242 void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) { |
| 243 prefs->RegisterDictionaryPref(kExtensionURLOverrides); | 243 prefs->RegisterDictionaryPref(kExtensionURLOverrides, |
| 244 PrefService::UNSYNCABLE_PREF); |
| 244 } | 245 } |
| 245 | 246 |
| 246 // static | 247 // static |
| 247 bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) { | 248 bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) { |
| 248 if (!url->SchemeIs(chrome::kChromeUIScheme)) | 249 if (!url->SchemeIs(chrome::kChromeUIScheme)) |
| 249 return false; | 250 return false; |
| 250 | 251 |
| 251 const DictionaryValue* overrides = | 252 const DictionaryValue* overrides = |
| 252 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); | 253 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); |
| 253 std::string page = url->host(); | 254 std::string page = url->host(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 } | 450 } |
| 450 | 451 |
| 451 // static | 452 // static |
| 452 void ExtensionWebUI::GetFaviconForURL(Profile* profile, | 453 void ExtensionWebUI::GetFaviconForURL(Profile* profile, |
| 453 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 454 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
| 454 // tracker deletes itself when done. | 455 // tracker deletes itself when done. |
| 455 ExtensionWebUIImageLoadingTracker* tracker = | 456 ExtensionWebUIImageLoadingTracker* tracker = |
| 456 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); | 457 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); |
| 457 tracker->Init(); | 458 tracker->Init(); |
| 458 } | 459 } |
| OLD | NEW |