| 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/wm/window_state.h" |   15 #include "ash/common/wm/window_state.h" | 
|   17 #include "ash/default_wallpaper_delegate.h" |   16 #include "ash/default_wallpaper_delegate.h" | 
|   18 #include "ash/public/cpp/shell_window_ids.h" |   17 #include "ash/public/cpp/shell_window_ids.h" | 
|   19 #include "ash/shell.h" |   18 #include "ash/shell.h" | 
|   20 #include "ash/shell/context_menu.h" |   19 #include "ash/shell/context_menu.h" | 
|   21 #include "ash/shell/example_factory.h" |   20 #include "ash/shell/example_factory.h" | 
|   22 #include "ash/shell/toplevel_window.h" |   21 #include "ash/shell/toplevel_window.h" | 
|   23 #include "ash/test/test_keyboard_ui.h" |   22 #include "ash/test/test_keyboard_ui.h" | 
|   24 #include "ash/test/test_shelf_delegate.h" |   23 #include "ash/test/test_shelf_delegate.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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  262 } |  236 } | 
|  263  |  237  | 
|  264 SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() { |  238 SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() { | 
|  265   return new SessionStateDelegateImpl; |  239   return new SessionStateDelegateImpl; | 
|  266 } |  240 } | 
|  267  |  241  | 
|  268 AccessibilityDelegate* ShellDelegateImpl::CreateAccessibilityDelegate() { |  242 AccessibilityDelegate* ShellDelegateImpl::CreateAccessibilityDelegate() { | 
|  269   return new DefaultAccessibilityDelegate; |  243   return new DefaultAccessibilityDelegate; | 
|  270 } |  244 } | 
|  271  |  245  | 
|  272 NewWindowDelegate* ShellDelegateImpl::CreateNewWindowDelegate() { |  | 
|  273   return new NewWindowDelegateImpl; |  | 
|  274 } |  | 
|  275  |  | 
|  276 MediaDelegate* ShellDelegateImpl::CreateMediaDelegate() { |  246 MediaDelegate* ShellDelegateImpl::CreateMediaDelegate() { | 
|  277   return new MediaDelegateImpl; |  247   return new MediaDelegateImpl; | 
|  278 } |  248 } | 
|  279  |  249  | 
|  280 std::unique_ptr<PaletteDelegate> ShellDelegateImpl::CreatePaletteDelegate() { |  250 std::unique_ptr<PaletteDelegate> ShellDelegateImpl::CreatePaletteDelegate() { | 
|  281   return base::MakeUnique<PaletteDelegateImpl>(); |  251   return base::MakeUnique<PaletteDelegateImpl>(); | 
|  282 } |  252 } | 
|  283  |  253  | 
|  284 ui::MenuModel* ShellDelegateImpl::CreateContextMenu(WmShelf* wm_shelf, |  254 ui::MenuModel* ShellDelegateImpl::CreateContextMenu(WmShelf* wm_shelf, | 
|  285                                                     const ShelfItem* item) { |  255                                                     const ShelfItem* item) { | 
|  286   return new ContextMenu(wm_shelf); |  256   return new ContextMenu(wm_shelf); | 
|  287 } |  257 } | 
|  288  |  258  | 
|  289 GPUSupport* ShellDelegateImpl::CreateGPUSupport() { |  259 GPUSupport* ShellDelegateImpl::CreateGPUSupport() { | 
|  290   // Real GPU support depends on src/content, so just use a stub. |  260   // Real GPU support depends on src/content, so just use a stub. | 
|  291   return new GPUSupportStub; |  261   return new GPUSupportStub; | 
|  292 } |  262 } | 
|  293  |  263  | 
|  294 base::string16 ShellDelegateImpl::GetProductName() const { |  264 base::string16 ShellDelegateImpl::GetProductName() const { | 
|  295   return base::string16(); |  265   return base::string16(); | 
|  296 } |  266 } | 
|  297  |  267  | 
|  298 gfx::Image ShellDelegateImpl::GetDeprecatedAcceleratorImage() const { |  268 gfx::Image ShellDelegateImpl::GetDeprecatedAcceleratorImage() const { | 
|  299   return gfx::Image(); |  269   return gfx::Image(); | 
|  300 } |  270 } | 
|  301  |  271  | 
|  302 }  // namespace shell |  272 }  // namespace shell | 
|  303 }  // namespace ash |  273 }  // namespace ash | 
| OLD | NEW |