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" | |
10 #include "chrome/browser/app_mode/app_mode_utils.h" | 11 #include "chrome/browser/app_mode/app_mode_utils.h" |
11 #include "chrome/browser/lifetime/application_lifetime.h" | 12 #include "chrome/browser/lifetime/application_lifetime.h" |
12 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "chrome/browser/profiles/profiles_state.h" | 14 #include "chrome/browser/profiles/profiles_state.h" |
14 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 15 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
15 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" | 16 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" |
16 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" | 17 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" |
17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 18 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
18 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 19 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
19 #include "chrome/browser/ui/browser_commands.h" | 20 #include "chrome/browser/ui/browser_commands.h" |
21 #include "chrome/common/pref_names.h" | |
20 #include "chrome/grit/chromium_strings.h" | 22 #include "chrome/grit/chromium_strings.h" |
21 #include "components/signin/core/common/profile_management_switches.h" | 23 #include "components/signin/core/common/profile_management_switches.h" |
22 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
23 | 25 |
24 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 27 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
26 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 28 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
27 #include "components/user_manager/user_manager.h" | 29 #include "components/user_manager/user_manager.h" |
28 #endif | 30 #endif |
29 | 31 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 return chrome::IsRunningInForcedAppMode(); | 83 return chrome::IsRunningInForcedAppMode(); |
82 } | 84 } |
83 | 85 |
84 bool ChromeShellDelegate::IsMultiAccountEnabled() const { | 86 bool ChromeShellDelegate::IsMultiAccountEnabled() const { |
85 #if defined(OS_CHROMEOS) | 87 #if defined(OS_CHROMEOS) |
86 return switches::IsEnableAccountConsistency(); | 88 return switches::IsEnableAccountConsistency(); |
87 #endif | 89 #endif |
88 return false; | 90 return false; |
89 } | 91 } |
90 | 92 |
93 bool ChromeShellDelegate::IsFirstTimeMaximized() const { | |
94 #if defined(OS_CHROMEOS) | |
95 if (ProfileManager::GetActiveUserProfile()) { | |
bartfab (slow)
2015/03/12 11:54:47
The documentation for this method says that you sh
peletskyi
2015/03/18 13:28:13
Done.
| |
96 return ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean( | |
bartfab (slow)
2015/03/12 11:54:47
Nit: #include "chrome/browser/profiles/profile.h"
peletskyi
2015/03/18 13:28:13
Done.
| |
97 prefs::kForceMaximizeBrowserWindowOnFirstRun); | |
98 } | |
99 #endif | |
100 return false; | |
101 } | |
102 | |
91 void ChromeShellDelegate::Exit() { | 103 void ChromeShellDelegate::Exit() { |
92 chrome::AttemptUserExit(); | 104 chrome::AttemptUserExit(); |
93 } | 105 } |
94 | 106 |
95 content::BrowserContext* ChromeShellDelegate::GetActiveBrowserContext() { | 107 content::BrowserContext* ChromeShellDelegate::GetActiveBrowserContext() { |
96 #if defined(OS_CHROMEOS) | 108 #if defined(OS_CHROMEOS) |
97 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); | 109 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); |
98 #endif | 110 #endif |
99 return ProfileManager::GetActiveUserProfile(); | 111 return ProfileManager::GetActiveUserProfile(); |
100 } | 112 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 | 164 |
153 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( | 165 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( |
154 ash::VirtualKeyboardStateObserver* observer) { | 166 ash::VirtualKeyboardStateObserver* observer) { |
155 keyboard_state_observer_list_.AddObserver(observer); | 167 keyboard_state_observer_list_.AddObserver(observer); |
156 } | 168 } |
157 | 169 |
158 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( | 170 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( |
159 ash::VirtualKeyboardStateObserver* observer) { | 171 ash::VirtualKeyboardStateObserver* observer) { |
160 keyboard_state_observer_list_.RemoveObserver(observer); | 172 keyboard_state_observer_list_.RemoveObserver(observer); |
161 } | 173 } |
OLD | NEW |