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

Unified Diff: chrome/browser/extensions/extension_protocols.cc

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_protocols.cc
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index 006d1d9265f5b6b01ed776a847b05f2c1f936e8f..01290747e6e53d5dee42eba023160a05a65f3392 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/extensions/image_loader.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/extensions/api/icons/icons_handler.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/extension_resource.h"
@@ -316,7 +317,8 @@ bool AllowExtensionResourceLoad(net::URLRequest* request,
std::string resource_root_relative_path =
request->url().path().empty() ? "" : request->url().path().substr(1);
if (extension->is_hosted_app() &&
- !extension->icons().ContainsPath(resource_root_relative_path)) {
+ !extensions::IconsInfo::GetIcons(extension).ContainsPath(
+ resource_root_relative_path)) {
LOG(ERROR) << "Denying load of " << request->url().spec() << " from "
<< "hosted app.";
return false;
@@ -347,7 +349,7 @@ bool URLIsForExtensionIcon(const GURL& url, const Extension* extension) {
DCHECK_EQ(url.host(), extension->id());
DCHECK(path.length() > 0 && path[0] == '/');
path = path.substr(1);
- return extension->icons().ContainsPath(path);
+ return extensions::IconsInfo::GetIcons(extension).ContainsPath(path);
}
class ExtensionProtocolHandler

Powered by Google App Engine
This is Rietveld 408576698