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

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: Rebase again 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_content/content_action.h » ('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 b06ae7004eca48dc190a61cafb20a18592d2b422..8e15acf877f12eef61e5a1f1aed0c29d1c0c2fcf 100644
--- a/chrome/browser/extensions/api/declarative/declarative_rule.h
+++ b/chrome/browser/extensions/api/declarative/declarative_rule.h
@@ -156,6 +156,12 @@ class DeclarativeActionSet {
const base::Time& extension_install_time,
typename ActionT::ApplyInfo* apply_info) const;
+ // Rules call this method when their conditions are fulfilled, but Apply has
+ // already been called.
+ void Reapply(const std::string& extension_id,
+ const base::Time& extension_install_time,
+ typename ActionT::ApplyInfo* apply_info) const;
+
// Rules call this method when they have stateful conditions, and those
// conditions stop being fulfilled. Rules with event-based conditions (e.g. a
// network request happened) will never Revert() an action.
@@ -384,6 +390,16 @@ void DeclarativeActionSet<ActionT>::Apply(
}
template<typename ActionT>
+void DeclarativeActionSet<ActionT>::Reapply(
+ 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>
void DeclarativeActionSet<ActionT>::Revert(
const std::string& extension_id,
const base::Time& extension_install_time,
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative_content/content_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698