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

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

Issue 9500003: Add a button to exit managed mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 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_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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698