Chromium Code Reviews| 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 "base/prefs/pref_service.h" | |
|
bartfab (slow)
2015/04/01 14:22:43
Nit: Move this to the #if defined(OS_CHROMEOS) sec
peletskyi
2015/04/01 18:55:47
Done.
| |
| 10 #include "chrome/browser/app_mode/app_mode_utils.h" | 11 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 12 #include "chrome/browser/chromeos/profiles/profile_helper.h" | |
|
bartfab (slow)
2015/04/01 14:22:43
Nit: Move this to the #if defined(OS_CHROMEOS) sec
peletskyi
2015/04/01 18:55:47
Done.
| |
| 11 #include "chrome/browser/lifetime/application_lifetime.h" | 13 #include "chrome/browser/lifetime/application_lifetime.h" |
| 14 #include "chrome/browser/profiles/profile.h" | |
|
bartfab (slow)
2015/04/01 14:22:43
Nit: Move this to the #if defined(OS_CHROMEOS) sec
peletskyi
2015/04/01 18:55:47
Done.
| |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/profiles/profiles_state.h" | 16 #include "chrome/browser/profiles/profiles_state.h" |
| 14 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 17 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 15 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" | 18 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" |
| 16 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" | 19 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" |
| 17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 18 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 21 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 19 #include "chrome/browser/ui/browser_commands.h" | 22 #include "chrome/browser/ui/browser_commands.h" |
| 23 #include "chrome/common/pref_names.h" | |
|
bartfab (slow)
2015/04/01 14:22:43
Nit: Move this to the #if defined(OS_CHROMEOS) sec
peletskyi
2015/04/01 18:55:47
Done.
| |
| 20 #include "chrome/grit/chromium_strings.h" | 24 #include "chrome/grit/chromium_strings.h" |
| 21 #include "components/signin/core/common/profile_management_switches.h" | 25 #include "components/signin/core/common/profile_management_switches.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 23 | 27 |
| 24 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 26 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 30 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
| 27 #include "components/user_manager/user_manager.h" | 31 #include "components/user_manager/user_manager.h" |
| 28 #endif | 32 #endif |
| 29 | 33 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 return chrome::IsRunningInForcedAppMode(); | 85 return chrome::IsRunningInForcedAppMode(); |
| 82 } | 86 } |
| 83 | 87 |
| 84 bool ChromeShellDelegate::IsMultiAccountEnabled() const { | 88 bool ChromeShellDelegate::IsMultiAccountEnabled() const { |
| 85 #if defined(OS_CHROMEOS) | 89 #if defined(OS_CHROMEOS) |
| 86 return switches::IsEnableAccountConsistency(); | 90 return switches::IsEnableAccountConsistency(); |
| 87 #endif | 91 #endif |
| 88 return false; | 92 return false; |
| 89 } | 93 } |
| 90 | 94 |
| 95 bool ChromeShellDelegate::ForceMaximizeOnFirstRun() const { | |
| 96 #if defined(OS_CHROMEOS) | |
| 97 const user_manager::User* const user = | |
|
bartfab (slow)
2015/04/01 14:22:43
Nit: #include "components/user_manager/user.h"
peletskyi
2015/04/01 18:55:47
Done.
| |
| 98 user_manager::UserManager::Get()->GetActiveUser(); | |
| 99 if (user) | |
|
bartfab (slow)
2015/04/01 14:22:43
Nit: Add curly braces.
peletskyi
2015/04/01 18:55:47
Done.
| |
| 100 return chromeos::ProfileHelper::Get() | |
| 101 ->GetProfileByUser(user) | |
| 102 ->GetPrefs() | |
| 103 ->GetBoolean(prefs::kForceMaximizeOnFirstRun); | |
| 104 #endif | |
| 105 return false; | |
| 106 } | |
| 107 | |
| 91 void ChromeShellDelegate::Exit() { | 108 void ChromeShellDelegate::Exit() { |
| 92 chrome::AttemptUserExit(); | 109 chrome::AttemptUserExit(); |
| 93 } | 110 } |
| 94 | 111 |
| 95 content::BrowserContext* ChromeShellDelegate::GetActiveBrowserContext() { | 112 content::BrowserContext* ChromeShellDelegate::GetActiveBrowserContext() { |
| 96 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
| 97 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); | 114 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); |
| 98 #endif | 115 #endif |
| 99 return ProfileManager::GetActiveUserProfile(); | 116 return ProfileManager::GetActiveUserProfile(); |
| 100 } | 117 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 | 169 |
| 153 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( | 170 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( |
| 154 ash::VirtualKeyboardStateObserver* observer) { | 171 ash::VirtualKeyboardStateObserver* observer) { |
| 155 keyboard_state_observer_list_.AddObserver(observer); | 172 keyboard_state_observer_list_.AddObserver(observer); |
| 156 } | 173 } |
| 157 | 174 |
| 158 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( | 175 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( |
| 159 ash::VirtualKeyboardStateObserver* observer) { | 176 ash::VirtualKeyboardStateObserver* observer) { |
| 160 keyboard_state_observer_list_.RemoveObserver(observer); | 177 keyboard_state_observer_list_.RemoveObserver(observer); |
| 161 } | 178 } |
| OLD | NEW |