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 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 static void RegisterPrefs(PrefService* prefs); | 34 static void RegisterPrefs(PrefService* prefs); |
35 static bool IsInManagedMode(); | 35 static bool IsInManagedMode(); |
36 | 36 |
37 // Calls |callback| with the argument true iff managed mode was entered | 37 // Calls |callback| with the argument true iff managed mode was entered |
38 // sucessfully. | 38 // sucessfully. |
39 static void EnterManagedMode(Profile* profile, const EnterCallback& callback); | 39 static void EnterManagedMode(Profile* profile, const EnterCallback& callback); |
40 static void LeaveManagedMode(); | 40 static void LeaveManagedMode(); |
41 | 41 |
42 // BrowserList::Observer implementation: | 42 // BrowserList::Observer implementation: |
43 virtual void OnBrowserAdded(const Browser* browser) OVERRIDE; | 43 virtual void OnBrowserAdded(Browser* browser) OVERRIDE; |
44 virtual void OnBrowserRemoved(const Browser* browser) OVERRIDE; | 44 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; |
45 | 45 |
46 // content::NotificationObserver implementation: | 46 // content::NotificationObserver implementation: |
47 virtual void Observe(int type, | 47 virtual void Observe(int type, |
48 const content::NotificationSource& source, | 48 const content::NotificationSource& source, |
49 const content::NotificationDetails& details) OVERRIDE; | 49 const content::NotificationDetails& details) OVERRIDE; |
50 | 50 |
51 protected: | 51 protected: |
52 ManagedMode(); | 52 ManagedMode(); |
53 virtual ~ManagedMode(); | 53 virtual ~ManagedMode(); |
54 void EnterManagedModeImpl(Profile* profile, const EnterCallback& callback); | 54 void EnterManagedModeImpl(Profile* profile, const EnterCallback& callback); |
(...skipping 14 matching lines...) Expand all Loading... |
69 virtual bool PlatformConfirmLeave(); | 69 virtual bool PlatformConfirmLeave(); |
70 | 70 |
71 virtual bool IsInManagedModeImpl(); | 71 virtual bool IsInManagedModeImpl(); |
72 virtual void SetInManagedMode(bool in_managed_mode); | 72 virtual void SetInManagedMode(bool in_managed_mode); |
73 | 73 |
74 content::NotificationRegistrar registrar_; | 74 content::NotificationRegistrar registrar_; |
75 | 75 |
76 // 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 |
77 // managed mode. | 77 // managed mode. |
78 const Profile* managed_profile_; | 78 const Profile* managed_profile_; |
79 std::set<const Browser*> browsers_to_close_; | 79 std::set<Browser*> browsers_to_close_; |
80 std::vector<EnterCallback> callbacks_; | 80 std::vector<EnterCallback> callbacks_; |
81 }; | 81 }; |
82 | 82 |
83 #endif // CHROME_BROWSER_MANAGED_MODE_H_ | 83 #endif // CHROME_BROWSER_MANAGED_MODE_H_ |
OLD | NEW |