| 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/test/test_shell_delegate.h" | 5 #include "ash/test/test_shell_delegate.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "ash/caps_lock_delegate_stub.h" | 9 #include "ash/caps_lock_delegate_stub.h" |
| 10 #include "ash/default_accessibility_delegate.h" | 10 #include "ash/default_accessibility_delegate.h" |
| 11 #include "ash/host/root_window_host_factory.h" | 11 #include "ash/host/root_window_host_factory.h" |
| 12 #include "ash/keyboard_controller_proxy_stub.h" | 12 #include "ash/keyboard_controller_proxy_stub.h" |
| 13 #include "ash/media_delegate.h" |
| 13 #include "ash/new_window_delegate.h" | 14 #include "ash/new_window_delegate.h" |
| 14 #include "ash/session_state_delegate.h" | 15 #include "ash/session_state_delegate.h" |
| 15 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 16 #include "ash/shell_window_ids.h" | 17 #include "ash/shell_window_ids.h" |
| 17 #include "ash/test/test_launcher_delegate.h" | 18 #include "ash/test/test_launcher_delegate.h" |
| 18 #include "ash/test/test_session_state_delegate.h" | 19 #include "ash/test/test_session_state_delegate.h" |
| 19 #include "ash/test/test_system_tray_delegate.h" | 20 #include "ash/test/test_system_tray_delegate.h" |
| 20 #include "ash/test/test_user_wallpaper_delegate.h" | 21 #include "ash/test/test_user_wallpaper_delegate.h" |
| 21 #include "ash/wm/window_state.h" | 22 #include "ash/wm/window_state.h" |
| 22 #include "ash/wm/window_util.h" | 23 #include "ash/wm/window_util.h" |
| 23 #include "base/logging.h" | 24 #include "base/logging.h" |
| 24 #include "content/public/test/test_browser_context.h" | 25 #include "content/public/test/test_browser_context.h" |
| 25 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
| 26 | 27 |
| 27 namespace ash { | 28 namespace ash { |
| 28 namespace test { | 29 namespace test { |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 class NewWindowDelegateImpl : public NewWindowDelegate { | 32 class NewWindowDelegateImpl : public NewWindowDelegate { |
| 32 virtual void NewTab() OVERRIDE {} | 33 virtual void NewTab() OVERRIDE {} |
| 33 virtual void NewWindow(bool incognito) OVERRIDE {} | 34 virtual void NewWindow(bool incognito) OVERRIDE {} |
| 34 virtual void OpenFileManager() OVERRIDE {} | 35 virtual void OpenFileManager() OVERRIDE {} |
| 35 virtual void OpenCrosh() OVERRIDE {} | 36 virtual void OpenCrosh() OVERRIDE {} |
| 36 virtual void RestoreTab() OVERRIDE {} | 37 virtual void RestoreTab() OVERRIDE {} |
| 37 virtual void ShowKeyboardOverlay() OVERRIDE {} | 38 virtual void ShowKeyboardOverlay() OVERRIDE {} |
| 38 virtual void ShowTaskManager() OVERRIDE {} | 39 virtual void ShowTaskManager() OVERRIDE {} |
| 39 virtual void OpenFeedbackPage() OVERRIDE {} | 40 virtual void OpenFeedbackPage() OVERRIDE {} |
| 40 }; | 41 }; |
| 41 | 42 |
| 43 class MediaDelegateImpl : public MediaDelegate { |
| 44 public: |
| 45 virtual void HandleMediaNextTrack() OVERRIDE {} |
| 46 virtual void HandleMediaPlayPause() OVERRIDE {} |
| 47 virtual void HandleMediaPrevTrack() OVERRIDE {} |
| 48 }; |
| 49 |
| 42 } // namespace | 50 } // namespace |
| 43 | 51 |
| 44 TestShellDelegate::TestShellDelegate() | 52 TestShellDelegate::TestShellDelegate() |
| 45 : num_exit_requests_(0), | 53 : num_exit_requests_(0), |
| 46 multi_profiles_enabled_(false), | 54 multi_profiles_enabled_(false), |
| 47 test_session_state_delegate_(NULL) { | 55 test_session_state_delegate_(NULL) { |
| 48 } | 56 } |
| 49 | 57 |
| 50 TestShellDelegate::~TestShellDelegate() { | 58 TestShellDelegate::~TestShellDelegate() { |
| 51 } | 59 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 122 } |
| 115 | 123 |
| 116 AccessibilityDelegate* TestShellDelegate::CreateAccessibilityDelegate() { | 124 AccessibilityDelegate* TestShellDelegate::CreateAccessibilityDelegate() { |
| 117 return new internal::DefaultAccessibilityDelegate(); | 125 return new internal::DefaultAccessibilityDelegate(); |
| 118 } | 126 } |
| 119 | 127 |
| 120 NewWindowDelegate* TestShellDelegate::CreateNewWindowDelegate() { | 128 NewWindowDelegate* TestShellDelegate::CreateNewWindowDelegate() { |
| 121 return new NewWindowDelegateImpl; | 129 return new NewWindowDelegateImpl; |
| 122 } | 130 } |
| 123 | 131 |
| 132 MediaDelegate* TestShellDelegate::CreateMediaDelegate() { |
| 133 return new MediaDelegateImpl; |
| 134 } |
| 135 |
| 124 aura::client::UserActionClient* TestShellDelegate::CreateUserActionClient() { | 136 aura::client::UserActionClient* TestShellDelegate::CreateUserActionClient() { |
| 125 return NULL; | 137 return NULL; |
| 126 } | 138 } |
| 127 | 139 |
| 128 void TestShellDelegate::RecordUserMetricsAction(UserMetricsAction action) { | 140 void TestShellDelegate::RecordUserMetricsAction(UserMetricsAction action) { |
| 129 } | 141 } |
| 130 | 142 |
| 131 void TestShellDelegate::HandleMediaNextTrack() { | |
| 132 } | |
| 133 | |
| 134 void TestShellDelegate::HandleMediaPlayPause() { | |
| 135 } | |
| 136 | |
| 137 void TestShellDelegate::HandleMediaPrevTrack() { | |
| 138 } | |
| 139 | |
| 140 ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::Window* root) { | 143 ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::Window* root) { |
| 141 return NULL; | 144 return NULL; |
| 142 } | 145 } |
| 143 | 146 |
| 144 RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { | 147 RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { |
| 145 return RootWindowHostFactory::Create(); | 148 return RootWindowHostFactory::Create(); |
| 146 } | 149 } |
| 147 | 150 |
| 148 base::string16 TestShellDelegate::GetProductName() const { | 151 base::string16 TestShellDelegate::GetProductName() const { |
| 149 return base::string16(); | 152 return base::string16(); |
| 150 } | 153 } |
| 151 | 154 |
| 152 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { | 155 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { |
| 153 return test_session_state_delegate_; | 156 return test_session_state_delegate_; |
| 154 } | 157 } |
| 155 | 158 |
| 156 } // namespace test | 159 } // namespace test |
| 157 } // namespace ash | 160 } // namespace ash |
| OLD | NEW |