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

Unified Diff: chrome/browser/protector/protector_service.h

Issue 9968007: [protector] Support for collapsing multiple changes into a single one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tried to compile after merge. Created 8 years, 8 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/protector/protector_service.h
diff --git a/chrome/browser/protector/protector_service.h b/chrome/browser/protector/protector_service.h
index 7d0637d3541ac1c56237897615abe9071cfb1ea8..9eb49d6ed1b9b786d8544c73c1c172817fad528b 100644
--- a/chrome/browser/protector/protector_service.h
+++ b/chrome/browser/protector/protector_service.h
@@ -78,8 +78,16 @@ class ProtectorService : public ProfileKeyedService,
~Item();
linked_ptr<BaseSettingChange> change;
linked_ptr<SettingsChangeGlobalError> error;
+ // When true, this means |change| was merged with another instance and
+ // |error| is in process of being removed from GlobalErrorService.
+ bool is_merging;
whywhat 2012/04/06 16:28:32 Why merging, not merged as in comment?
Ivan Korotkov 2012/04/09 14:46:47 Fixed
+ // Meaningful only when |merged| is true. In that case, true means that the
+ // new merged GlobalError instance will be immediately shown.
+ bool show_when_merged;
whywhat 2012/04/06 16:28:32 This makes three states represented with two boole
Ivan Korotkov 2012/04/09 14:46:47 Hm, it doesn't look like a tri-state flag to merge
whywhat 2012/04/10 09:55:44 Both booleans above define three states out of pos
Ivan Korotkov 2012/04/10 11:19:49 I meant that, enum would be good if those were 3 d
};
+ typedef std::vector<Item> Items;
+
// Matches Item by |change| field.
class MatchItemByChange {
public:
@@ -102,6 +110,10 @@ class ProtectorService : public ProfileKeyedService,
const SettingsChangeGlobalError* other_;
};
+ // Returns an Item instance whose change can be merged with |change|, if any.
whywhat 2012/04/06 16:28:32 What if there're multiple items that can be merged
Ivan Korotkov 2012/04/09 14:46:47 Merging strategy is (and should be) transitive so
+ // Otherwise returns |NULL|.
+ Item* FindItemToMergeWith(const BaseSettingChange* change);
+
// ProfileKeyedService implementation.
virtual void Shutdown() OVERRIDE;
@@ -115,7 +127,7 @@ class ProtectorService : public ProfileKeyedService,
// Pointers to error bubble controllers and corresponding changes in the order
// added.
- std::vector<Item> items_;
+ Items items_;
// Profile which settings we are protecting.
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698