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

Unified Diff: extensions/browser/api/declarative/declarative_rule.h

Issue 822453002: Introduce HostID and de-couple Extensions from "script injection System" [browser side] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 11 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: extensions/browser/api/declarative/declarative_rule.h
diff --git a/extensions/browser/api/declarative/declarative_rule.h b/extensions/browser/api/declarative/declarative_rule.h
index b612f271d6407864c99400abb174e6b551bf8971..8dd3837d6bb0f5e49fcb648f394a8ff16768b57f 100644
--- a/extensions/browser/api/declarative/declarative_rule.h
+++ b/extensions/browser/api/declarative/declarative_rule.h
@@ -23,6 +23,7 @@
#include "components/url_matcher/url_matcher.h"
#include "extensions/common/api/events.h"
#include "extensions/common/extension.h"
+#include "extensions/common/host_id.h"
namespace base {
class Time;
@@ -152,6 +153,7 @@ class DeclarativeActionSet {
// the extension API.
static scoped_ptr<DeclarativeActionSet> Create(
content::BrowserContext* browser_context,
+ const HostID& host_id,
const Extension* extension,
const AnyVector& actions,
std::string* error,
@@ -230,6 +232,7 @@ class DeclarativeRule {
static scoped_ptr<DeclarativeRule> Create(
url_matcher::URLMatcherConditionFactory* url_matcher_condition_factory,
content::BrowserContext* browser_context,
+ const HostID& host_id,
const Extension* extension,
base::Time extension_installation_time,
linked_ptr<JsonRule> rule,
@@ -366,6 +369,7 @@ template<typename ActionT>
scoped_ptr<DeclarativeActionSet<ActionT> >
DeclarativeActionSet<ActionT>::Create(
content::BrowserContext* browser_context,
+ const HostID& host_id,
const Extension* extension,
const AnyVector& actions,
std::string* error,
@@ -378,7 +382,8 @@ DeclarativeActionSet<ActionT>::Create(
i != actions.end(); ++i) {
CHECK(i->get());
scoped_refptr<const ActionT> action =
- ActionT::Create(browser_context, extension, **i, error, bad_message);
+ ActionT::Create(
+ browser_context, host_id, extension, **i, error, bad_message);
if (!error->empty() || *bad_message)
return scoped_ptr<DeclarativeActionSet>();
result.push_back(action);
@@ -455,6 +460,7 @@ scoped_ptr<DeclarativeRule<ConditionT, ActionT> >
DeclarativeRule<ConditionT, ActionT>::Create(
url_matcher::URLMatcherConditionFactory* url_matcher_condition_factory,
content::BrowserContext* browser_context,
+ const HostID& host_id,
const Extension* extension,
base::Time extension_installation_time,
linked_ptr<JsonRule> rule,
@@ -470,8 +476,8 @@ DeclarativeRule<ConditionT, ActionT>::Create(
bool bad_message = false;
scoped_ptr<ActionSet> actions =
- ActionSet::Create(
- browser_context, extension, rule->actions, error, &bad_message);
+ ActionSet::Create(browser_context, host_id, extension,
+ rule->actions, error, &bad_message);
if (bad_message) {
// TODO(battre) Export concept of bad_message to caller, the extension
// should be killed in case it is true.

Powered by Google App Engine
This is Rietveld 408576698