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

Side by Side 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: Fixed comment 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PROTECTOR_PROTECTOR_H_
6 #define CHROME_BROWSER_PROTECTOR_PROTECTOR_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/task.h"
13 #include "chrome/browser/protector/setting_change.h"
14 #include "chrome/browser/protector/settings_change_global_error.h"
15
16 class GURL;
17 class Profile;
18 class TemplateURLService;
19
20 namespace protector {
21
22 // Accumulates settings changes and shows them altogether to user.
23 // Deletes itself when changes are shown to the user and some action is taken
24 // or timeout expires.
25 class Protector : public SettingsChangeGlobalError::Delegate {
26 public:
27 explicit Protector(Profile* profile);
28
29 // Opens a tab with specified URL in the browser window we've shown error
30 // bubble for.
31 void OpenTab(const GURL& url);
32
33 // Returns TemplateURLService for the profile we've shown error bubble
34 // for.
35 TemplateURLService* GetTemplateURLService();
36
37 // Shows global error about the specified change. Ownership of the change
38 // is passed to the error object.
39 void ShowChange(SettingChange* change);
40
41 // SettingsChangeGlobalError::Delegate implementation.
42 virtual void OnApplyChanges() OVERRIDE;
43 virtual void OnDiscardChanges() OVERRIDE;
44 virtual void OnDecisionTimeout() OVERRIDE;
45
46 private:
47 friend class DeleteTask<Protector>;
48
49 // The object can only be allocated and destroyed on heap.
50 virtual ~Protector();
51
52 // Common handler for error delegate handlers. Calls the specified method
53 // on each change we showed error for.
54 void OnChangesAction(SettingChangeAction action);
55
56 // Pointer to error bubble controller. Indicates if we're showing change
57 // notification to user. Owns itself.
58 scoped_ptr<SettingsChangeGlobalError> error_;
59
60 // Profile which settings we are protecting.
61 Profile* profile_;
62
63 DISALLOW_COPY_AND_ASSIGN(Protector);
64 };
65
66 // Signs string value with protector's key.
67 std::string SignSetting(const std::string& value);
68
69 } // namespace protector
70
71 #endif // CHROME_BROWSER_PROTECTOR_PROTECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698