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

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

Issue 8342049: Added Protector, hooked up DSE verification with error bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/settings_change_global_error.h
diff --git a/chrome/browser/protector/settings_change_global_error.h b/chrome/browser/protector/settings_change_global_error.h
index 2c17075831f6856605d5aee874534c093ad23ed2..0dbd970bec6c2aeaa7bf34dae2e93e39636ebf43 100644
--- a/chrome/browser/protector/settings_change_global_error.h
+++ b/chrome/browser/protector/settings_change_global_error.h
@@ -13,30 +13,21 @@
#include "base/compiler_specific.h"
#include "base/string16.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/protector/protector.h"
#include "chrome/browser/ui/global_error.h"
+class Browser;
class Profile;
+namespace protector {
+
// Global error about unwanted settings changes.
class SettingsChangeGlobalError : public GlobalError {
public:
- enum ChangeType {
- kSearchEngineChanged = 0, // Default search engine has been changed.
- kHomePageChanged, // Home page has been changed.
- };
-
- struct Change {
- ChangeType type; // Which setting has been changed.
- string16 old_setting; // Old setting value or "" if unknown.
- string16 new_setting; // New setting value.
- };
-
- typedef std::vector<Change> ChangesVector;
-
// Creates new global error about settings changes |changes|.
// If user decides to apply changes, |make_changes_cb| is called.
// If user decides to keep previous settings, |restore_changes_cb| is called.
- SettingsChangeGlobalError(const ChangesVector& changes,
+ SettingsChangeGlobalError(const Protector::ChangesVector& changes,
const base::Closure& make_changes_cb,
const base::Closure& restore_changes_cb);
virtual ~SettingsChangeGlobalError();
@@ -45,6 +36,9 @@ class SettingsChangeGlobalError : public GlobalError {
// Can be called from any thread.
void ShowForDefaultProfile();
+ Profile* profile() const { return profile_; }
+ Browser* browser() const { return browser_; }
Ivan Korotkov 2011/10/19 20:24:37 Document these please.
whywhat 2011/10/20 20:50:10 Done.
+
// GlobalError implementation.
virtual bool HasBadge() OVERRIDE;
virtual bool HasMenuItem() OVERRIDE;
@@ -61,7 +55,7 @@ class SettingsChangeGlobalError : public GlobalError {
virtual void BubbleViewCancelButtonPressed() OVERRIDE;
private:
- ChangesVector changes_;
+ Protector::ChangesVector changes_;
base::Closure make_changes_cb_;
base::Closure restore_changes_cb_;
@@ -69,6 +63,9 @@ class SettingsChangeGlobalError : public GlobalError {
// Profile that we have been added to.
Profile* profile_;
+ // Browser that we have been shown for.
+ Browser* browser_;
+
// True if user has dismissed the bubble by clicking on one of the buttons.
bool closed_by_button_;
@@ -87,4 +84,6 @@ class SettingsChangeGlobalError : public GlobalError {
DISALLOW_COPY_AND_ASSIGN(SettingsChangeGlobalError);
};
+} // namespace protector
+
#endif // CHROME_BROWSER_PROTECTOR_SETTINGS_CHANGE_GLOBAL_ERROR_H_

Powered by Google App Engine
This is Rietveld 408576698