Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698