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

Unified Diff: chrome/renderer/extensions/extension_renderer_info.h

Issue 3263007: Reland r57788 - Expose Extension Bindings to Component Applications (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: don't hide gallery url in omnibar Created 10 years, 4 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/renderer/extensions/extension_renderer_info.h
diff --git a/chrome/renderer/extensions/extension_renderer_info.h b/chrome/renderer/extensions/extension_renderer_info.h
index ec0d9a304a6e57a8dc0f1fc2965646c397d77b96..926f275dd05563aeed36ee1f784515b0b3ed4365 100644
--- a/chrome/renderer/extensions/extension_renderer_info.h
+++ b/chrome/renderer/extensions/extension_renderer_info.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/gtest_prod_util.h"
+#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_extent.h"
#include "googleurl/src/gurl.h"
@@ -34,6 +35,13 @@ class ExtensionRendererInfo {
// Returns the extension ID that the given URL is a part of, or empty if
// none. This includes web URLs that are part of an extension's web extent.
+ static std::string GetIdByURL(const GURL& url);
+
+ // Returns the ExtensionRendererInfo that the given URL is a part of, or NULL
+ // if none. This includes web URLs that are part of an extension's web extent.
+ // NOTE: This can return NULL if called before UpdateExtensions receives
+ // bulk extension data (e.g. if called from
+ // EventBindings::HandleContextCreated)
static ExtensionRendererInfo* GetByURL(const GURL& url);
// Returns true if |new_url| is in the extent of the same extension as
@@ -43,6 +51,11 @@ class ExtensionRendererInfo {
// Look up an ExtensionInfo object by id.
static ExtensionRendererInfo* GetByID(const std::string& id);
+ // Returns true if |url| should get extension api bindings and be permitted
+ // to make api calls. Note that this is independent of what extension
+ // permissions the given extension has been granted.
+ static bool ExtensionBindingsAllowed(const GURL& url);
+
private:
void Update(const ViewMsg_ExtensionRendererInfo& info);
@@ -51,6 +64,7 @@ class ExtensionRendererInfo {
std::string id_;
ExtensionExtent web_extent_;
std::string name_;
+ Extension::Location location_;
GURL icon_url_;
// static
« no previous file with comments | « chrome/renderer/extensions/extension_process_bindings.cc ('k') | chrome/renderer/extensions/extension_renderer_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698