| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 const char ExtensionWebUI::kExtensionURLOverrides[] = | 123 const char ExtensionWebUI::kExtensionURLOverrides[] = |
| 124 "extensions.chrome_url_overrides"; | 124 "extensions.chrome_url_overrides"; |
| 125 | 125 |
| 126 ExtensionWebUI::ExtensionWebUI(content::WebUI* web_ui, const GURL& url) | 126 ExtensionWebUI::ExtensionWebUI(content::WebUI* web_ui, const GURL& url) |
| 127 : WebUIController(web_ui), | 127 : WebUIController(web_ui), |
| 128 url_(url) { | 128 url_(url) { |
| 129 Profile* profile = Profile::FromWebUI(web_ui); | 129 Profile* profile = Profile::FromWebUI(web_ui); |
| 130 ExtensionService* service = profile->GetExtensionService(); | 130 ExtensionService* service = profile->GetExtensionService(); |
| 131 const Extension* extension = | 131 const Extension* extension = |
| 132 service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url)); | 132 service->extensions()->GetExtensionOrAppByURL(url); |
| 133 DCHECK(extension); | 133 DCHECK(extension); |
| 134 | 134 |
| 135 // The base class defaults to enabling WebUI bindings, but we don't need | 135 // The base class defaults to enabling WebUI bindings, but we don't need |
| 136 // those (this is also reflected in ChromeWebUIControllerFactory:: | 136 // those (this is also reflected in ChromeWebUIControllerFactory:: |
| 137 // UseWebUIBindingsForURL). | 137 // UseWebUIBindingsForURL). |
| 138 int bindings = 0; | 138 int bindings = 0; |
| 139 | 139 |
| 140 // Bind externalHost to Extension WebUI loaded in Chrome Frame. | 140 // Bind externalHost to Extension WebUI loaded in Chrome Frame. |
| 141 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 141 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
| 142 if (browser_command_line.HasSwitch(switches::kChromeFrame)) | 142 if (browser_command_line.HasSwitch(switches::kChromeFrame)) |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, | 417 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, |
| 418 gfx::Size(pixel_size, pixel_size), | 418 gfx::Size(pixel_size, pixel_size), |
| 419 scale_factors[i])); | 419 scale_factors[i])); |
| 420 } | 420 } |
| 421 | 421 |
| 422 // LoadImagesAsync actually can run callback synchronously. We want to force | 422 // LoadImagesAsync actually can run callback synchronously. We want to force |
| 423 // async. | 423 // async. |
| 424 extensions::ImageLoader::Get(profile)->LoadImagesAsync( | 424 extensions::ImageLoader::Get(profile)->LoadImagesAsync( |
| 425 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); | 425 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); |
| 426 } | 426 } |
| OLD | NEW |