| 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 "ash/shell/shell_delegate_impl.h" | 5 #include "ash/shell/shell_delegate_impl.h" |
| 6 | 6 |
| 7 #include "ash/app_list/app_list_presenter_delegate_factory.h" | 7 #include "ash/app_list/app_list_presenter_delegate_factory.h" |
| 8 #include "ash/common/accessibility_delegate.h" | 8 #include "ash/common/accessibility_delegate.h" |
| 9 #include "ash/common/default_accessibility_delegate.h" | 9 #include "ash/common/default_accessibility_delegate.h" |
| 10 #include "ash/common/gpu_support_stub.h" | 10 #include "ash/common/gpu_support_stub.h" |
| 11 #include "ash/common/media_delegate.h" | 11 #include "ash/common/media_delegate.h" |
| 12 #include "ash/common/new_window_delegate.h" | |
| 13 #include "ash/common/palette_delegate.h" | 12 #include "ash/common/palette_delegate.h" |
| 14 #include "ash/common/session/session_state_delegate.h" | 13 #include "ash/common/session/session_state_delegate.h" |
| 15 #include "ash/common/system/tray/default_system_tray_delegate.h" | 14 #include "ash/common/system/tray/default_system_tray_delegate.h" |
| 16 #include "ash/common/test/test_shelf_delegate.h" | 15 #include "ash/common/test/test_shelf_delegate.h" |
| 17 #include "ash/common/wm/window_state.h" | 16 #include "ash/common/wm/window_state.h" |
| 18 #include "ash/default_wallpaper_delegate.h" | 17 #include "ash/default_wallpaper_delegate.h" |
| 19 #include "ash/public/cpp/shell_window_ids.h" | 18 #include "ash/public/cpp/shell_window_ids.h" |
| 20 #include "ash/shell.h" | 19 #include "ash/shell.h" |
| 21 #include "ash/shell/context_menu.h" | 20 #include "ash/shell/context_menu.h" |
| 22 #include "ash/shell/example_factory.h" | 21 #include "ash/shell/example_factory.h" |
| 23 #include "ash/shell/toplevel_window.h" | 22 #include "ash/shell/toplevel_window.h" |
| 24 #include "ash/test/test_keyboard_ui.h" | 23 #include "ash/test/test_keyboard_ui.h" |
| 25 #include "base/memory/ptr_util.h" | 24 #include "base/memory/ptr_util.h" |
| 26 #include "base/message_loop/message_loop.h" | 25 #include "base/message_loop/message_loop.h" |
| 27 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| 28 #include "components/user_manager/user_info_impl.h" | 27 #include "components/user_manager/user_info_impl.h" |
| 29 #include "ui/app_list/app_list_view_delegate.h" | 28 #include "ui/app_list/app_list_view_delegate.h" |
| 30 #include "ui/app_list/presenter/app_list_presenter_impl.h" | 29 #include "ui/app_list/presenter/app_list_presenter_impl.h" |
| 31 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" | 30 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" |
| 32 #include "ui/aura/window.h" | 31 #include "ui/aura/window.h" |
| 33 #include "ui/gfx/image/image.h" | 32 #include "ui/gfx/image/image.h" |
| 34 #include "ui/gfx/image/image_skia.h" | 33 #include "ui/gfx/image/image_skia.h" |
| 35 | 34 |
| 36 namespace ash { | 35 namespace ash { |
| 37 namespace shell { | 36 namespace shell { |
| 38 namespace { | 37 namespace { |
| 39 | 38 |
| 40 class NewWindowDelegateImpl : public NewWindowDelegate { | |
| 41 public: | |
| 42 NewWindowDelegateImpl() {} | |
| 43 ~NewWindowDelegateImpl() override {} | |
| 44 | |
| 45 // NewWindowDelegate: | |
| 46 void NewTab() override {} | |
| 47 void NewWindow(bool incognito) override { | |
| 48 ToplevelWindow::CreateParams create_params; | |
| 49 create_params.can_resize = true; | |
| 50 create_params.can_maximize = true; | |
| 51 ToplevelWindow::CreateToplevelWindow(create_params); | |
| 52 } | |
| 53 void OpenFileManager() override {} | |
| 54 void OpenCrosh() override {} | |
| 55 void OpenGetHelp() override {} | |
| 56 void RestoreTab() override {} | |
| 57 void ShowKeyboardOverlay() override {} | |
| 58 void ShowTaskManager() override {} | |
| 59 void OpenFeedbackPage() override {} | |
| 60 | |
| 61 private: | |
| 62 DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl); | |
| 63 }; | |
| 64 | |
| 65 class MediaDelegateImpl : public MediaDelegate { | 39 class MediaDelegateImpl : public MediaDelegate { |
| 66 public: | 40 public: |
| 67 MediaDelegateImpl() {} | 41 MediaDelegateImpl() {} |
| 68 ~MediaDelegateImpl() override {} | 42 ~MediaDelegateImpl() override {} |
| 69 | 43 |
| 70 // MediaDelegate: | 44 // MediaDelegate: |
| 71 void HandleMediaNextTrack() override {} | 45 void HandleMediaNextTrack() override {} |
| 72 void HandleMediaPlayPause() override {} | 46 void HandleMediaPlayPause() override {} |
| 73 void HandleMediaPrevTrack() override {} | 47 void HandleMediaPrevTrack() override {} |
| 74 MediaCaptureState GetMediaCaptureState(UserIndex index) override { | 48 MediaCaptureState GetMediaCaptureState(UserIndex index) override { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 232 } |
| 259 | 233 |
| 260 SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() { | 234 SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() { |
| 261 return new SessionStateDelegateImpl; | 235 return new SessionStateDelegateImpl; |
| 262 } | 236 } |
| 263 | 237 |
| 264 AccessibilityDelegate* ShellDelegateImpl::CreateAccessibilityDelegate() { | 238 AccessibilityDelegate* ShellDelegateImpl::CreateAccessibilityDelegate() { |
| 265 return new DefaultAccessibilityDelegate; | 239 return new DefaultAccessibilityDelegate; |
| 266 } | 240 } |
| 267 | 241 |
| 268 NewWindowDelegate* ShellDelegateImpl::CreateNewWindowDelegate() { | |
| 269 return new NewWindowDelegateImpl; | |
| 270 } | |
| 271 | |
| 272 MediaDelegate* ShellDelegateImpl::CreateMediaDelegate() { | 242 MediaDelegate* ShellDelegateImpl::CreateMediaDelegate() { |
| 273 return new MediaDelegateImpl; | 243 return new MediaDelegateImpl; |
| 274 } | 244 } |
| 275 | 245 |
| 276 std::unique_ptr<PaletteDelegate> ShellDelegateImpl::CreatePaletteDelegate() { | 246 std::unique_ptr<PaletteDelegate> ShellDelegateImpl::CreatePaletteDelegate() { |
| 277 return base::MakeUnique<PaletteDelegateImpl>(); | 247 return base::MakeUnique<PaletteDelegateImpl>(); |
| 278 } | 248 } |
| 279 | 249 |
| 280 ui::MenuModel* ShellDelegateImpl::CreateContextMenu(WmShelf* wm_shelf, | 250 ui::MenuModel* ShellDelegateImpl::CreateContextMenu(WmShelf* wm_shelf, |
| 281 const ShelfItem* item) { | 251 const ShelfItem* item) { |
| 282 return new ContextMenu(wm_shelf); | 252 return new ContextMenu(wm_shelf); |
| 283 } | 253 } |
| 284 | 254 |
| 285 GPUSupport* ShellDelegateImpl::CreateGPUSupport() { | 255 GPUSupport* ShellDelegateImpl::CreateGPUSupport() { |
| 286 // Real GPU support depends on src/content, so just use a stub. | 256 // Real GPU support depends on src/content, so just use a stub. |
| 287 return new GPUSupportStub; | 257 return new GPUSupportStub; |
| 288 } | 258 } |
| 289 | 259 |
| 290 base::string16 ShellDelegateImpl::GetProductName() const { | 260 base::string16 ShellDelegateImpl::GetProductName() const { |
| 291 return base::string16(); | 261 return base::string16(); |
| 292 } | 262 } |
| 293 | 263 |
| 294 gfx::Image ShellDelegateImpl::GetDeprecatedAcceleratorImage() const { | 264 gfx::Image ShellDelegateImpl::GetDeprecatedAcceleratorImage() const { |
| 295 return gfx::Image(); | 265 return gfx::Image(); |
| 296 } | 266 } |
| 297 | 267 |
| 298 } // namespace shell | 268 } // namespace shell |
| 299 } // namespace ash | 269 } // namespace ash |
| OLD | NEW |