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

Side by Side Diff: chrome/browser/managed_mode/managed_mode.h

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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_MANAGED_MODE_MANAGED_MODE_H_ 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_H_
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_H_ 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/singleton.h" 15 #include "base/memory/singleton.h"
16 #include "chrome/browser/extensions/management_policy.h" 16 #include "chrome/browser/extensions/management_policy.h"
17 #include "chrome/browser/ui/browser_list_observer.h" 17 #include "chrome/browser/ui/browser_list_observer.h"
18 #include "content/public/browser/notification_observer.h" 18 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 19 #include "content/public/browser/notification_registrar.h"
20 20
21 class Browser; 21 class Browser;
22 template<typename T> 22 template<typename T>
23 struct DefaultSingletonTraits; 23 struct DefaultSingletonTraits;
24 class ManagedModeSiteList; 24 class ManagedModeSiteList;
25 class ManagedModeURLFilter; 25 class ManagedModeURLFilter;
26 class PrefChangeRegistrar; 26 class PrefChangeRegistrar;
27 class PrefServiceSimple; 27 class PrefRegistrarSimple;
28 class PrefServiceSyncable; 28 class PrefServiceSyncable;
29 class Profile; 29 class Profile;
30 30
31 // Managed mode allows one person to manage the Chrome experience for another 31 // Managed mode allows one person to manage the Chrome experience for another
32 // person by pre-configuring and then locking a managed User profile. 32 // person by pre-configuring and then locking a managed User profile.
33 // The ManagedMode class provides methods to check whether the browser is in 33 // The ManagedMode class provides methods to check whether the browser is in
34 // managed mode, and to attempt to enter or leave managed mode. 34 // managed mode, and to attempt to enter or leave managed mode.
35 // Except where otherwise noted, this class should be used on the UI thread. 35 // Except where otherwise noted, this class should be used on the UI thread.
36 class ManagedMode : public chrome::BrowserListObserver, 36 class ManagedMode : public chrome::BrowserListObserver,
37 public extensions::ManagementPolicy::Provider, 37 public extensions::ManagementPolicy::Provider,
38 public content::NotificationObserver { 38 public content::NotificationObserver {
39 public: 39 public:
40 typedef base::Callback<void(bool)> EnterCallback; 40 typedef base::Callback<void(bool)> EnterCallback;
41 41
42 static void RegisterPrefs(PrefServiceSimple* prefs); 42 static void RegisterPrefs(PrefRegistrarSimple* prefs);
43 static void RegisterUserPrefs(PrefServiceSyncable* prefs); 43 static void RegisterUserPrefs(PrefServiceSyncable* prefs);
44 44
45 // Initializes the singleton, setting the managed_profile_. Must be called 45 // Initializes the singleton, setting the managed_profile_. Must be called
46 // after g_browser_process and the LocalState have been created. 46 // after g_browser_process and the LocalState have been created.
47 static void Init(Profile* profile); 47 static void Init(Profile* profile);
48 static bool IsInManagedMode(); 48 static bool IsInManagedMode();
49 49
50 // Calls |callback| with the argument true iff managed mode was entered 50 // Calls |callback| with the argument true iff managed mode was entered
51 // sucessfully. 51 // sucessfully.
52 static void EnterManagedMode(Profile* profile, const EnterCallback& callback); 52 static void EnterManagedMode(Profile* profile, const EnterCallback& callback);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 scoped_ptr<URLFilterContext> io_url_filter_context_; 140 scoped_ptr<URLFilterContext> io_url_filter_context_;
141 scoped_ptr<URLFilterContext> ui_url_filter_context_; 141 scoped_ptr<URLFilterContext> ui_url_filter_context_;
142 142
143 std::set<Browser*> browsers_to_close_; 143 std::set<Browser*> browsers_to_close_;
144 std::vector<EnterCallback> callbacks_; 144 std::vector<EnterCallback> callbacks_;
145 145
146 DISALLOW_COPY_AND_ASSIGN(ManagedMode); 146 DISALLOW_COPY_AND_ASSIGN(ManagedMode);
147 }; 147 };
148 148
149 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_H_ 149 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698