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