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

Side by Side Diff: chrome/browser/ui/webui/options/managed_user_settings_handler.h

Issue 12594029: Create interface to manage manual exceptions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor fix Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_
7 7
8 #include "base/prefs/pref_change_registrar.h" 8 #include "base/prefs/pref_change_registrar.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/managed_mode/managed_user_service.h"
11 #include "chrome/browser/ui/webui/options/options_ui.h" 12 #include "chrome/browser/ui/webui/options/options_ui.h"
12 13
13 namespace options { 14 namespace options {
14 15
15 class ManagedUserSettingsHandler : public OptionsPageUIHandler { 16 class ManagedUserSettingsHandler : public OptionsPageUIHandler {
16 public: 17 public:
17 ManagedUserSettingsHandler(); 18 ManagedUserSettingsHandler();
18 virtual ~ManagedUserSettingsHandler(); 19 virtual ~ManagedUserSettingsHandler();
19 20
20 // OptionsPageUIHandler implementation. 21 // OptionsPageUIHandler implementation.
21 virtual void GetLocalizedValues( 22 virtual void GetLocalizedValues(
22 base::DictionaryValue* localized_strings) OVERRIDE; 23 base::DictionaryValue* localized_strings) OVERRIDE;
23 24
24 virtual void InitializeHandler() OVERRIDE; 25 virtual void InitializeHandler() OVERRIDE;
25 virtual void InitializePage() OVERRIDE; 26 virtual void InitializePage() OVERRIDE;
26 virtual void RegisterMessages() OVERRIDE; 27 virtual void RegisterMessages() OVERRIDE;
27 28
28 private: 29 private:
29 // Save user metrics. Called from WebUI. 30 // Save user metrics. Called from WebUI.
30 void SaveMetrics(const base::ListValue* args); 31 void SaveMetrics(const base::ListValue* args);
31 32
32 // Records metric that the settings page was opened. Called from WebUI. 33 // Records metric that the settings page was opened. Called from WebUI.
33 void HandlePageOpened(const base::ListValue* args); 34 void HandlePageOpened(const base::ListValue* args);
34 35
35 // Called when the local passphrase changes. 36 // Called when the local passphrase changes.
36 void OnLocalPassphraseChanged(); 37 void OnLocalPassphraseChanged();
37 38
39 // Called to decide whether a given pattern is valid, or if it should be
James Hawkins 2013/04/02 15:57:33 Optional nit: s/Called to decide/Decides/
Sergiu 2013/04/02 17:14:09 Done.
40 // rejected. Called while the user is editing an exception pattern.
41 void CheckManualExceptionValidity(const base::ListValue* args);
42
43 // Sets the manual behavior for |pattern|. If pattern looks like a host (no
44 // schema) then update the manual host list, otherwise update the manual
45 // URL list.
46 void UpdateManualBehavior(std::string pattern,
47 ManagedUserService::ManualBehavior behavior);
48
49 // Removes the given row from the table. The first entry in |args| is
50 // the pattern to remove.
51 void RemoveManualException(const base::ListValue* args);
52
53 // Changes the value of an exception. Called after the user is done editing an
54 // exception.
55 void SetManualException(const base::ListValue* args);
56
57 // Updates the current view by reading the entries from the managed mode
58 // service and updating the WebUI model.
59 void UpdateViewFromModel();
60
38 // For tracking how long the user spends on this page. 61 // For tracking how long the user spends on this page.
39 base::TimeTicks start_time_; 62 base::TimeTicks start_time_;
40 63
41 PrefChangeRegistrar pref_change_registrar_; 64 PrefChangeRegistrar pref_change_registrar_;
42 65
43 DISALLOW_COPY_AND_ASSIGN(ManagedUserSettingsHandler); 66 DISALLOW_COPY_AND_ASSIGN(ManagedUserSettingsHandler);
44 }; 67 };
45 68
46 } // namespace options 69 } // namespace options
47 70
48 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_ 71 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698