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/ui/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include "ash/content_support/gpu_support_impl.h" | 7 #include "ash/content_support/gpu_support_impl.h" |
8 #include "ash/wm/window_state.h" | 8 #include "ash/wm/window_state.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "chrome/browser/app_mode/app_mode_utils.h" | 10 #include "chrome/browser/app_mode/app_mode_utils.h" |
11 #include "chrome/browser/lifetime/application_lifetime.h" | 11 #include "chrome/browser/lifetime/application_lifetime.h" |
12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "chrome/browser/profiles/profiles_state.h" | 13 #include "chrome/browser/profiles/profiles_state.h" |
14 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 14 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
15 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" | 15 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" |
16 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" | 16 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" |
17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
18 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 18 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
19 #include "chrome/browser/ui/browser_commands.h" | 19 #include "chrome/browser/ui/browser_commands.h" |
20 #include "chrome/grit/chromium_strings.h" | 20 #include "chrome/grit/chromium_strings.h" |
21 #include "components/signin/core/common/profile_management_switches.h" | 21 #include "components/signin/core/common/profile_management_switches.h" |
22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
23 | 23 |
24 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
| 25 #include "base/prefs/pref_service.h" |
25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
26 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 27 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
| 28 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 29 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/common/pref_names.h" |
| 31 #include "components/user_manager/user.h" |
27 #include "components/user_manager/user_manager.h" | 32 #include "components/user_manager/user_manager.h" |
28 #endif | 33 #endif |
29 | 34 |
30 // static | 35 // static |
31 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; | 36 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; |
32 | 37 |
33 ChromeShellDelegate::ChromeShellDelegate() | 38 ChromeShellDelegate::ChromeShellDelegate() |
34 : shelf_delegate_(NULL) { | 39 : shelf_delegate_(NULL) { |
35 instance_ = this; | 40 instance_ = this; |
36 PlatformInit(); | 41 PlatformInit(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return chrome::IsRunningInForcedAppMode(); | 86 return chrome::IsRunningInForcedAppMode(); |
82 } | 87 } |
83 | 88 |
84 bool ChromeShellDelegate::IsMultiAccountEnabled() const { | 89 bool ChromeShellDelegate::IsMultiAccountEnabled() const { |
85 #if defined(OS_CHROMEOS) | 90 #if defined(OS_CHROMEOS) |
86 return switches::IsEnableAccountConsistency(); | 91 return switches::IsEnableAccountConsistency(); |
87 #endif | 92 #endif |
88 return false; | 93 return false; |
89 } | 94 } |
90 | 95 |
| 96 bool ChromeShellDelegate::ForceMaximizeOnFirstRun() const { |
| 97 #if defined(OS_CHROMEOS) |
| 98 const user_manager::User* const user = |
| 99 user_manager::UserManager::Get()->GetActiveUser(); |
| 100 if (user) { |
| 101 return chromeos::ProfileHelper::Get() |
| 102 ->GetProfileByUser(user) |
| 103 ->GetPrefs() |
| 104 ->GetBoolean(prefs::kForceMaximizeOnFirstRun); |
| 105 } |
| 106 #endif |
| 107 return false; |
| 108 } |
| 109 |
91 void ChromeShellDelegate::Exit() { | 110 void ChromeShellDelegate::Exit() { |
92 chrome::AttemptUserExit(); | 111 chrome::AttemptUserExit(); |
93 } | 112 } |
94 | 113 |
95 content::BrowserContext* ChromeShellDelegate::GetActiveBrowserContext() { | 114 content::BrowserContext* ChromeShellDelegate::GetActiveBrowserContext() { |
96 #if defined(OS_CHROMEOS) | 115 #if defined(OS_CHROMEOS) |
97 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); | 116 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); |
98 #endif | 117 #endif |
99 return ProfileManager::GetActiveUserProfile(); | 118 return ProfileManager::GetActiveUserProfile(); |
100 } | 119 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 171 |
153 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( | 172 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( |
154 ash::VirtualKeyboardStateObserver* observer) { | 173 ash::VirtualKeyboardStateObserver* observer) { |
155 keyboard_state_observer_list_.AddObserver(observer); | 174 keyboard_state_observer_list_.AddObserver(observer); |
156 } | 175 } |
157 | 176 |
158 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( | 177 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( |
159 ash::VirtualKeyboardStateObserver* observer) { | 178 ash::VirtualKeyboardStateObserver* observer) { |
160 keyboard_state_observer_list_.RemoveObserver(observer); | 179 keyboard_state_observer_list_.RemoveObserver(observer); |
161 } | 180 } |
OLD | NEW |