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

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

Issue 493633003: Browser changes for wiring up RequestContentScript API to shared memory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit: Inline methods in unit tests Created 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/declarative_rule_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/declarative_rule.h
diff --git a/chrome/browser/extensions/api/declarative/declarative_rule.h b/chrome/browser/extensions/api/declarative/declarative_rule.h
index 8e15acf877f12eef61e5a1f1aed0c29d1c0c2fcf..3d286f060a6fd44b28182fdffb2b5e374b112093 100644
--- a/chrome/browser/extensions/api/declarative/declarative_rule.h
+++ b/chrome/browser/extensions/api/declarative/declarative_rule.h
@@ -29,6 +29,10 @@ class Time;
class Value;
}
+namespace content {
+class BrowserContext;
+}
+
namespace extensions {
// This class stores a set of conditions that may be part of a DeclarativeRule.
@@ -146,10 +150,12 @@ class DeclarativeActionSet {
// Factory method that instantiates a DeclarativeActionSet for |extension|
// according to |actions| which represents the array of actions received from
// the extension API.
- static scoped_ptr<DeclarativeActionSet> Create(const Extension* extension,
- const AnyVector& actions,
- std::string* error,
- bool* bad_message);
+ static scoped_ptr<DeclarativeActionSet> Create(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ const AnyVector& actions,
+ std::string* error,
+ bool* bad_message);
// Rules call this method when their conditions are fulfilled.
void Apply(const std::string& extension_id,
@@ -223,6 +229,7 @@ class DeclarativeRule {
// the returned rule is internally consistent.
static scoped_ptr<DeclarativeRule> Create(
url_matcher::URLMatcherConditionFactory* url_matcher_condition_factory,
+ content::BrowserContext* browser_context,
const Extension* extension,
base::Time extension_installation_time,
linked_ptr<JsonRule> rule,
@@ -358,6 +365,7 @@ DeclarativeActionSet<ActionT>::DeclarativeActionSet(const Actions& actions)
template<typename ActionT>
scoped_ptr<DeclarativeActionSet<ActionT> >
DeclarativeActionSet<ActionT>::Create(
+ content::BrowserContext* browser_context,
const Extension* extension,
const AnyVector& actions,
std::string* error,
@@ -370,7 +378,7 @@ DeclarativeActionSet<ActionT>::Create(
i != actions.end(); ++i) {
CHECK(i->get());
scoped_refptr<const ActionT> action =
- ActionT::Create(extension, **i, error, bad_message);
+ ActionT::Create(browser_context, extension, **i, error, bad_message);
if (!error->empty() || *bad_message)
return scoped_ptr<DeclarativeActionSet>();
result.push_back(action);
@@ -446,6 +454,7 @@ template<typename ConditionT, typename ActionT>
scoped_ptr<DeclarativeRule<ConditionT, ActionT> >
DeclarativeRule<ConditionT, ActionT>::Create(
url_matcher::URLMatcherConditionFactory* url_matcher_condition_factory,
+ content::BrowserContext* browser_context,
const Extension* extension,
base::Time extension_installation_time,
linked_ptr<JsonRule> rule,
@@ -461,7 +470,8 @@ DeclarativeRule<ConditionT, ActionT>::Create(
bool bad_message = false;
scoped_ptr<ActionSet> actions =
- ActionSet::Create(extension, rule->actions, error, &bad_message);
+ ActionSet::Create(
+ browser_context, 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.
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/declarative_rule_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698