| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 gfx::NativeView ExtensionWebUI::GetNativeViewOfHost() { | 229 gfx::NativeView ExtensionWebUI::GetNativeViewOfHost() { |
| 230 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); | 230 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); |
| 231 return rwhv ? rwhv->GetNativeView() : NULL; | 231 return rwhv ? rwhv->GetNativeView() : NULL; |
| 232 } | 232 } |
| 233 | 233 |
| 234 //////////////////////////////////////////////////////////////////////////////// | 234 //////////////////////////////////////////////////////////////////////////////// |
| 235 // chrome:// URL overrides | 235 // chrome:// URL overrides |
| 236 | 236 |
| 237 // static | 237 // static |
| 238 void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) { | 238 void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) { |
| 239 prefs->RegisterDictionaryPref(kExtensionURLOverrides); | 239 prefs->RegisterDictionaryPref(kExtensionURLOverrides, |
| 240 false /* don't sync pref */); |
| 240 } | 241 } |
| 241 | 242 |
| 242 // static | 243 // static |
| 243 bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) { | 244 bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) { |
| 244 if (!url->SchemeIs(chrome::kChromeUIScheme)) | 245 if (!url->SchemeIs(chrome::kChromeUIScheme)) |
| 245 return false; | 246 return false; |
| 246 | 247 |
| 247 const DictionaryValue* overrides = | 248 const DictionaryValue* overrides = |
| 248 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); | 249 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); |
| 249 std::string page = url->host(); | 250 std::string page = url->host(); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 } | 410 } |
| 410 | 411 |
| 411 // static | 412 // static |
| 412 void ExtensionWebUI::GetFaviconForURL(Profile* profile, | 413 void ExtensionWebUI::GetFaviconForURL(Profile* profile, |
| 413 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 414 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
| 414 // tracker deletes itself when done. | 415 // tracker deletes itself when done. |
| 415 ExtensionWebUIImageLoadingTracker* tracker = | 416 ExtensionWebUIImageLoadingTracker* tracker = |
| 416 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); | 417 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); |
| 417 tracker->Init(); | 418 tracker->Init(); |
| 418 } | 419 } |
| OLD | NEW |