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 #include "chrome/browser/managed_mode.h" | 5 #include "chrome/browser/managed_mode.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 11 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
12 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 12 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
| 13 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
14 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
17 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
18 | 19 |
19 // static | 20 // static |
20 ManagedMode* ManagedMode::GetInstance() { | 21 ManagedMode* ManagedMode::GetInstance() { |
21 return Singleton<ManagedMode>::get(); | 22 return Singleton<ManagedMode>::get(); |
22 } | 23 } |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void ManagedMode::SetInManagedMode(bool in_managed_mode) { | 200 void ManagedMode::SetInManagedMode(bool in_managed_mode) { |
200 g_browser_process->local_state()->SetBoolean(prefs::kInManagedMode, | 201 g_browser_process->local_state()->SetBoolean(prefs::kInManagedMode, |
201 in_managed_mode); | 202 in_managed_mode); |
202 // This causes the avatar and the profile menu to get updated. | 203 // This causes the avatar and the profile menu to get updated. |
203 content::NotificationService::current()->Notify( | 204 content::NotificationService::current()->Notify( |
204 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 205 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
205 content::NotificationService::AllBrowserContextsAndSources(), | 206 content::NotificationService::AllBrowserContextsAndSources(), |
206 content::NotificationService::NoDetails()); | 207 content::NotificationService::NoDetails()); |
207 } | 208 } |
208 | 209 |
OLD | NEW |