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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 Profile* profile = Profile::FromWebUI(web_ui); | 134 Profile* profile = Profile::FromWebUI(web_ui); |
135 ExtensionService* service = profile->GetExtensionService(); | 135 ExtensionService* service = profile->GetExtensionService(); |
136 const Extension* extension = | 136 const Extension* extension = |
137 service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url)); | 137 service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url)); |
138 DCHECK(extension); | 138 DCHECK(extension); |
139 // Only hide the url for internal pages (e.g. chrome-extension or packaged | 139 // Only hide the url for internal pages (e.g. chrome-extension or packaged |
140 // component apps like bookmark manager. | 140 // component apps like bookmark manager. |
141 bool should_hide_url = !extension->is_hosted_app(); | 141 bool should_hide_url = !extension->is_hosted_app(); |
142 | 142 |
143 // The base class defaults to enabling WebUI bindings, but we don't need | 143 // The base class defaults to enabling WebUI bindings, but we don't need |
144 // those (this is also reflected in ChromeWebUIFactory:: | 144 // those (this is also reflected in ChromeWebUIControllerFactory:: |
145 // UseWebUIBindingsForURL). | 145 // UseWebUIBindingsForURL). |
146 int bindings = 0; | 146 int bindings = 0; |
147 | 147 |
148 // Bind externalHost to Extension WebUI loaded in Chrome Frame. | 148 // Bind externalHost to Extension WebUI loaded in Chrome Frame. |
149 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 149 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
150 if (browser_command_line.HasSwitch(switches::kChromeFrame)) | 150 if (browser_command_line.HasSwitch(switches::kChromeFrame)) |
151 bindings |= content::BINDINGS_POLICY_EXTERNAL_HOST; | 151 bindings |= content::BINDINGS_POLICY_EXTERNAL_HOST; |
152 // For chrome:// overrides, some of the defaults are a little different. | 152 // For chrome:// overrides, some of the defaults are a little different. |
153 GURL effective_url = web_ui->GetWebContents()->GetURL(); | 153 GURL effective_url = web_ui->GetWebContents()->GetURL(); |
154 if (effective_url.SchemeIs(chrome::kChromeUIScheme)) { | 154 if (effective_url.SchemeIs(chrome::kChromeUIScheme)) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 } | 410 } |
411 | 411 |
412 // static | 412 // static |
413 void ExtensionWebUI::GetFaviconForURL(Profile* profile, | 413 void ExtensionWebUI::GetFaviconForURL(Profile* profile, |
414 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 414 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
415 // tracker deletes itself when done. | 415 // tracker deletes itself when done. |
416 ExtensionWebUIImageLoadingTracker* tracker = | 416 ExtensionWebUIImageLoadingTracker* tracker = |
417 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); | 417 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); |
418 tracker->Init(); | 418 tracker->Init(); |
419 } | 419 } |
OLD | NEW |