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 "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/browser/ui/browser_finder.h" | |
| 21 #include "chrome/browser/ui/browser_navigator.h" | |
| 22 #include "chrome/browser/ui/browser_window.h" | |
| 20 #include "chrome/grit/chromium_strings.h" | 23 #include "chrome/grit/chromium_strings.h" |
| 21 #include "components/signin/core/common/profile_management_switches.h" | 24 #include "components/signin/core/common/profile_management_switches.h" |
| 25 #include "grit/theme_resources.h" | |
| 22 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | |
| 23 | 28 |
| 24 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 25 #include "base/prefs/pref_service.h" | 30 #include "base/prefs/pref_service.h" |
| 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 27 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 32 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
| 28 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 33 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 29 #include "chrome/browser/profiles/profile.h" | 34 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| 31 #include "components/user_manager/user.h" | 36 #include "components/user_manager/user.h" |
| 32 #include "components/user_manager/user_manager.h" | 37 #include "components/user_manager/user_manager.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 | 155 |
| 151 ash::GPUSupport* ChromeShellDelegate::CreateGPUSupport() { | 156 ash::GPUSupport* ChromeShellDelegate::CreateGPUSupport() { |
| 152 // Chrome uses real GPU support. | 157 // Chrome uses real GPU support. |
| 153 return new ash::GPUSupportImpl; | 158 return new ash::GPUSupportImpl; |
| 154 } | 159 } |
| 155 | 160 |
| 156 base::string16 ChromeShellDelegate::GetProductName() const { | 161 base::string16 ChromeShellDelegate::GetProductName() const { |
| 157 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 162 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 158 } | 163 } |
| 159 | 164 |
| 165 void ChromeShellDelegate::OpenKeyboardShortcutHelpPage() const { | |
| 166 Profile* profile = ProfileManager::GetActiveUserProfile(); | |
| 167 Browser* browser = | |
| 168 chrome::FindTabbedBrowser(profile, false, chrome::HOST_DESKTOP_TYPE_ASH); | |
| 169 | |
| 170 if (!browser) { | |
| 171 browser = new Browser( | |
| 172 Browser::CreateParams(profile, chrome::HOST_DESKTOP_TYPE_ASH)); | |
| 173 browser->window()->Activate(); | |
| 174 browser->window()->Show(); | |
| 175 } | |
| 176 | |
| 177 chrome::NavigateParams params( | |
| 178 browser, GURL("https://support.google.com/chromebook/answer/183101"), | |
|
oshima
2015/09/08 19:06:47
define constant with a comprehensive name.
afakhry
2015/09/08 21:47:35
Done.
| |
| 179 ui::PAGE_TRANSITION_AUTO_BOOKMARK); | |
| 180 params.disposition = SINGLETON_TAB; | |
| 181 chrome::Navigate(¶ms); | |
| 182 } | |
| 183 | |
| 184 gfx::Image ChromeShellDelegate::GetDeprecatedAcceleratorImage() const { | |
|
oshima
2015/09/08 19:06:46
for ash specific code, you can just use gfx::Image
afakhry
2015/09/08 21:47:35
As we discussed Notification ctor needs an Image.
| |
| 185 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( | |
| 186 IDR_BLUETOOTH_KEYBOARD); | |
| 187 } | |
| 188 | |
| 160 keyboard::KeyboardControllerProxy* | 189 keyboard::KeyboardControllerProxy* |
| 161 ChromeShellDelegate::CreateKeyboardControllerProxy() { | 190 ChromeShellDelegate::CreateKeyboardControllerProxy() { |
| 162 return new AshKeyboardControllerProxy( | 191 return new AshKeyboardControllerProxy( |
| 163 ProfileManager::GetActiveUserProfile()); | 192 ProfileManager::GetActiveUserProfile()); |
| 164 } | 193 } |
| 165 | 194 |
| 166 void ChromeShellDelegate::VirtualKeyboardActivated(bool activated) { | 195 void ChromeShellDelegate::VirtualKeyboardActivated(bool activated) { |
| 167 FOR_EACH_OBSERVER(ash::VirtualKeyboardStateObserver, | 196 FOR_EACH_OBSERVER(ash::VirtualKeyboardStateObserver, |
| 168 keyboard_state_observer_list_, | 197 keyboard_state_observer_list_, |
| 169 OnVirtualKeyboardStateChanged(activated)); | 198 OnVirtualKeyboardStateChanged(activated)); |
| 170 } | 199 } |
| 171 | 200 |
| 172 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( | 201 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( |
| 173 ash::VirtualKeyboardStateObserver* observer) { | 202 ash::VirtualKeyboardStateObserver* observer) { |
| 174 keyboard_state_observer_list_.AddObserver(observer); | 203 keyboard_state_observer_list_.AddObserver(observer); |
| 175 } | 204 } |
| 176 | 205 |
| 177 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( | 206 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( |
| 178 ash::VirtualKeyboardStateObserver* observer) { | 207 ash::VirtualKeyboardStateObserver* observer) { |
| 179 keyboard_state_observer_list_.RemoveObserver(observer); | 208 keyboard_state_observer_list_.RemoveObserver(observer); |
| 180 } | 209 } |
| OLD | NEW |