| 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 "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "ash/content_support/gpu_support_impl.h" | 9 #include "ash/content_support/gpu_support_impl.h" |
| 10 #include "ash/host/window_tree_host_factory.h" | 10 #include "ash/host/window_tree_host_factory.h" |
| 11 #include "ash/magnifier/magnifier_constants.h" | 11 #include "ash/magnifier/magnifier_constants.h" |
| 12 #include "ash/wm/window_state.h" | 12 #include "ash/wm/window_state.h" |
| 13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "chrome/browser/app_mode/app_mode_utils.h" | 15 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 16 #include "chrome/browser/lifetime/application_lifetime.h" | 16 #include "chrome/browser/lifetime/application_lifetime.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/browser/ui/app_list/app_list_service.h" | 18 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 19 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 19 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 20 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h" | 20 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h" |
| 21 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" | 21 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" |
| 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 23 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 23 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 24 #include "chrome/browser/ui/ash/user_action_handler.h" |
| 24 #include "chrome/browser/ui/browser_commands.h" | 25 #include "chrome/browser/ui/browser_commands.h" |
| 25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 26 #include "grit/chromium_strings.h" | 27 #include "grit/chromium_strings.h" |
| 27 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
| 28 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 29 | 30 |
| 30 #if defined(OS_CHROMEOS) | 31 #if defined(OS_CHROMEOS) |
| 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 32 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 32 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 33 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
| 33 #include "chrome/browser/chromeos/login/user_manager.h" | 34 #include "chrome/browser/chromeos/login/user_manager.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // TODO(oshima): This is currently broken with multiple launchers. | 118 // TODO(oshima): This is currently broken with multiple launchers. |
| 118 // Refactor so that there is just one launcher delegate in the | 119 // Refactor so that there is just one launcher delegate in the |
| 119 // shell. | 120 // shell. |
| 120 if (!shelf_delegate_) { | 121 if (!shelf_delegate_) { |
| 121 shelf_delegate_ = ChromeLauncherController::CreateInstance(NULL, model); | 122 shelf_delegate_ = ChromeLauncherController::CreateInstance(NULL, model); |
| 122 shelf_delegate_->Init(); | 123 shelf_delegate_->Init(); |
| 123 } | 124 } |
| 124 return shelf_delegate_; | 125 return shelf_delegate_; |
| 125 } | 126 } |
| 126 | 127 |
| 128 aura::client::UserActionClient* ChromeShellDelegate::CreateUserActionClient() { |
| 129 return new UserActionHandler; |
| 130 } |
| 131 |
| 127 ui::MenuModel* ChromeShellDelegate::CreateContextMenu( | 132 ui::MenuModel* ChromeShellDelegate::CreateContextMenu( |
| 128 aura::Window* root, | 133 aura::Window* root, |
| 129 ash::ShelfItemDelegate* item_delegate, | 134 ash::ShelfItemDelegate* item_delegate, |
| 130 ash::ShelfItem* item) { | 135 ash::ShelfItem* item) { |
| 131 DCHECK(shelf_delegate_); | 136 DCHECK(shelf_delegate_); |
| 132 // Don't show context menu for exclusive app runtime mode. | 137 // Don't show context menu for exclusive app runtime mode. |
| 133 if (chrome::IsRunningInAppMode()) | 138 if (chrome::IsRunningInAppMode()) |
| 134 return NULL; | 139 return NULL; |
| 135 | 140 |
| 136 if (item_delegate && item) | 141 if (item_delegate && item) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 149 } | 154 } |
| 150 | 155 |
| 151 base::string16 ChromeShellDelegate::GetProductName() const { | 156 base::string16 ChromeShellDelegate::GetProductName() const { |
| 152 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 157 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 153 } | 158 } |
| 154 | 159 |
| 155 keyboard::KeyboardControllerProxy* | 160 keyboard::KeyboardControllerProxy* |
| 156 ChromeShellDelegate::CreateKeyboardControllerProxy() { | 161 ChromeShellDelegate::CreateKeyboardControllerProxy() { |
| 157 return new AshKeyboardControllerProxy(); | 162 return new AshKeyboardControllerProxy(); |
| 158 } | 163 } |
| OLD | NEW |