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