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

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

Issue 491913003: Add Reapply() to declarative action interface. This is needed for RequestContentScript to work corr… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 b06ae7004eca48dc190a61cafb20a18592d2b422..3930d7f4d327e9e2598a1f26e0e5292f36833c4d 100644
--- a/chrome/browser/extensions/api/declarative/declarative_rule.h
+++ b/chrome/browser/extensions/api/declarative/declarative_rule.h
@@ -163,6 +163,12 @@ class DeclarativeActionSet {
const base::Time& extension_install_time,
typename ActionT::ApplyInfo* apply_info) const;
+ // Rules call this method when their conditions are checked and were already
+ // fulfilled previously.
+ void Reapply(const std::string& extension_id,
not at google - send to devlin 2014/08/21 00:32:56 nit: put this between Apply and Revert, since that
Mark Dittmer 2014/08/21 01:08:48 Done.
+ const base::Time& extension_install_time,
+ typename ActionT::ApplyInfo* apply_info) const;
+
// Returns the minimum priority of rules that may be evaluated after
// this rule. Defaults to MIN_INT.
int GetMinimumPriority() const;
@@ -394,6 +400,16 @@ void DeclarativeActionSet<ActionT>::Revert(
}
template<typename ActionT>
+void DeclarativeActionSet<ActionT>::Reapply(
not at google - send to devlin 2014/08/21 00:32:56 Ditto order.
Mark Dittmer 2014/08/21 01:08:48 Done.
+ const std::string& extension_id,
+ const base::Time& extension_install_time,
+ typename ActionT::ApplyInfo* apply_info) const {
+ for (typename Actions::const_iterator i = actions_.begin();
+ i != actions_.end(); ++i)
+ (*i)->Reapply(extension_id, extension_install_time, apply_info);
+}
+
+template<typename ActionT>
int DeclarativeActionSet<ActionT>::GetMinimumPriority() const {
int minimum_priority = std::numeric_limits<int>::min();
for (typename Actions::const_iterator i = actions_.begin();

Powered by Google App Engine
This is Rietveld 408576698