OLD | NEW |
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_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_H_ |
6 #define CHROME_BROWSER_MANAGED_MODE_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
18 | 18 |
19 class Browser; | 19 class Browser; |
20 template<typename T> | 20 template<typename T> |
21 struct DefaultSingletonTraits; | 21 struct DefaultSingletonTraits; |
22 class PrefService; | 22 class PrefService; |
23 class Profile; | 23 class Profile; |
24 | 24 |
| 25 // Managed mode allows one person to manage the Chrome experience for another |
| 26 // person by pre-configuring and then locking a managed User profile. |
| 27 // The ManagedMode class provides methods to check whether the browser is in |
| 28 // managed mode, and to attempt to enter or leave managed mode. |
25 class ManagedMode : public BrowserList::Observer, | 29 class ManagedMode : public BrowserList::Observer, |
26 public content::NotificationObserver { | 30 public content::NotificationObserver { |
27 public: | 31 public: |
28 typedef base::Callback<void(bool)> EnterCallback; | 32 typedef base::Callback<void(bool)> EnterCallback; |
29 | 33 |
30 static void RegisterPrefs(PrefService* prefs); | 34 static void RegisterPrefs(PrefService* prefs); |
31 static bool IsInManagedMode(); | 35 static bool IsInManagedMode(); |
32 | 36 |
33 // Calls |callback| with the argument true iff managed mode was entered | 37 // Calls |callback| with the argument true iff managed mode was entered |
34 // sucessfully. | 38 // sucessfully. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 content::NotificationRegistrar registrar_; | 74 content::NotificationRegistrar registrar_; |
71 | 75 |
72 // The managed profile. This is non-NULL only while we're entering | 76 // The managed profile. This is non-NULL only while we're entering |
73 // managed mode. | 77 // managed mode. |
74 const Profile* managed_profile_; | 78 const Profile* managed_profile_; |
75 std::set<const Browser*> browsers_to_close_; | 79 std::set<const Browser*> browsers_to_close_; |
76 std::vector<EnterCallback> callbacks_; | 80 std::vector<EnterCallback> callbacks_; |
77 }; | 81 }; |
78 | 82 |
79 #endif // CHROME_BROWSER_MANAGED_MODE_H_ | 83 #endif // CHROME_BROWSER_MANAGED_MODE_H_ |
OLD | NEW |