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

Unified Diff: chrome/browser/protector/composite_settings_change.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: 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/composite_settings_change.h
diff --git a/chrome/browser/protector/composite_settings_change.h b/chrome/browser/protector/composite_settings_change.h
new file mode 100644
index 0000000000000000000000000000000000000000..727dd9310f3eaf7d77ebfdb20402e9e7acb6660f
--- /dev/null
+++ b/chrome/browser/protector/composite_settings_change.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PROTECTOR_COMPOSITE_SETTINGS_CHANGE_H_
+#define CHROME_BROWSER_PROTECTOR_COMPOSITE_SETTINGS_CHANGE_H_
+#pragma once
+
+#include <queue>
+
+#include "base/memory/scoped_vector.h"
+#include "chrome/browser/protector/base_setting_change.h"
+
+namespace protector {
+
+// Class for tracking multiple settings changes as a single change.
+class CompositeSettingsChange : public BaseSettingChange {
+ public:
+ CompositeSettingsChange();
+ virtual ~CompositeSettingsChange();
+
+ // BaseSettingChange overrides:
+ virtual CompositeSettingsChange* MergeWith(BaseSettingChange* other) OVERRIDE;
+ virtual bool Contains(const BaseSettingChange* other) const OVERRIDE;
+ virtual void Apply(Browser* browser) OVERRIDE;
+ virtual void Discard(Browser* browser) OVERRIDE;
+ virtual void Timeout() OVERRIDE;
+ virtual int GetBadgeIconID() const OVERRIDE;
+ virtual int GetMenuItemIconID() const OVERRIDE;
+ virtual int GetBubbleIconID() const OVERRIDE;
+ virtual string16 GetBubbleTitle() const OVERRIDE;
+ virtual string16 GetBubbleMessage() const OVERRIDE;
+ virtual string16 GetApplyButtonText() const OVERRIDE;
+ virtual string16 GetDiscardButtonText() const OVERRIDE;
+ virtual DisplayName GetApplyDisplayName() const OVERRIDE;
+ virtual GURL GetNewSettingURL() const OVERRIDE;
+ virtual bool CanBeMerged() const OVERRIDE;
+
+ private:
+ // Vector with all merged changes.
+ ScopedVector<BaseSettingChange> changes_;
+
+ // Display names of merged changes, sorted by their priority. The name with
+ // the highest priority is picked.
+ std::priority_queue<DisplayName> apply_names_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompositeSettingsChange);
+};
+
+} // namespace protector
+
+#endif // CHROME_BROWSER_PROTECTOR_COMPOSITE_SETTINGS_CHANGE_H_
« no previous file with comments | « chrome/browser/protector/base_setting_change.cc ('k') | chrome/browser/protector/composite_settings_change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698