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

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

Issue 8342049: Added Protector, hooked up DSE verification with error bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved histograms to protector folder 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
« no previous file with comments | « chrome/browser/protector/keys.cc ('k') | chrome/browser/protector/protector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/protector/protector.h
diff --git a/chrome/browser/protector/protector.h b/chrome/browser/protector/protector.h
new file mode 100644
index 0000000000000000000000000000000000000000..c508d73aa022d3a90a6baca5cdb3757e9332d155
--- /dev/null
+++ b/chrome/browser/protector/protector.h
@@ -0,0 +1,73 @@
+// Copyright (c) 2011 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_PROTECTOR_H_
+#define CHROME_BROWSER_PROTECTOR_PROTECTOR_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/task.h"
+#include "chrome/browser/protector/setting_change.h"
+#include "chrome/browser/protector/settings_change_global_error_delegate.h"
+
+class GURL;
+class Profile;
+class TemplateURLService;
+
+namespace protector {
+
+class SettingsChangeGlobalError;
+
+// Accumulates settings changes and shows them altogether to user.
+// Deletes itself when changes are shown to the user and some action is taken
+// or timeout expires.
+class Protector : public SettingsChangeGlobalErrorDelegate {
+ public:
+ explicit Protector(Profile* profile);
+
+ // Opens a tab with specified URL in the browser window we've shown error
+ // bubble for.
+ void OpenTab(const GURL& url);
+
+ // Returns TemplateURLService for the profile we've shown error bubble
+ // for.
+ TemplateURLService* GetTemplateURLService();
+
+ // Shows global error about the specified change. Ownership of the change
+ // is passed to the error object.
+ void ShowChange(SettingChange* change);
+
+ // SettingsChangeGlobalErrorDelegate implementation.
+ virtual void OnApplyChanges() OVERRIDE;
+ virtual void OnDiscardChanges() OVERRIDE;
+ virtual void OnDecisionTimeout() OVERRIDE;
+
+ private:
+ friend class DeleteTask<Protector>;
+
+ // The object can only be allocated and destroyed on heap.
+ virtual ~Protector();
+
+ // Common handler for error delegate handlers. Calls the specified method
+ // on each change we showed error for.
+ void OnChangesAction(SettingChangeAction action);
+
+ // Pointer to error bubble controller. Indicates if we're showing change
+ // notification to user. Owns itself.
+ scoped_ptr<SettingsChangeGlobalError> error_;
+
+ // Profile which settings we are protecting.
+ Profile* profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(Protector);
+};
+
+// Signs string value with protector's key.
+std::string SignSetting(const std::string& value);
+
+} // namespace protector
+
+#endif // CHROME_BROWSER_PROTECTOR_PROTECTOR_H_
« no previous file with comments | « chrome/browser/protector/keys.cc ('k') | chrome/browser/protector/protector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698