| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 virtual void NewTab() OVERRIDE {} | 34 virtual void NewTab() OVERRIDE {} |
| 34 virtual void NewWindow(bool incognito) OVERRIDE {} | 35 virtual void NewWindow(bool incognito) OVERRIDE {} |
| 35 virtual void OpenFileManager() OVERRIDE {} | 36 virtual void OpenFileManager() OVERRIDE {} |
| 36 virtual void OpenCrosh() OVERRIDE {} | 37 virtual void OpenCrosh() OVERRIDE {} |
| 37 virtual void RestoreTab() OVERRIDE {} | 38 virtual void RestoreTab() OVERRIDE {} |
| 38 virtual void ShowKeyboardOverlay() OVERRIDE {} | 39 virtual void ShowKeyboardOverlay() OVERRIDE {} |
| 39 virtual void ShowTaskManager() OVERRIDE {} | 40 virtual void ShowTaskManager() OVERRIDE {} |
| 40 virtual void OpenFeedbackPage() OVERRIDE {} | 41 virtual void OpenFeedbackPage() OVERRIDE {} |
| 41 }; | 42 }; |
| 42 | 43 |
| 44 class MediaDelegateImpl : public MediaDelegate { |
| 45 public: |
| 46 virtual void HandleMediaNextTrack() OVERRIDE {} |
| 47 virtual void HandleMediaPlayPause() OVERRIDE {} |
| 48 virtual void HandleMediaPrevTrack() OVERRIDE {} |
| 49 }; |
| 50 |
| 43 } // namespace | 51 } // namespace |
| 44 | 52 |
| 45 TestShellDelegate::TestShellDelegate() | 53 TestShellDelegate::TestShellDelegate() |
| 46 : num_exit_requests_(0), | 54 : num_exit_requests_(0), |
| 47 multi_profiles_enabled_(false), | 55 multi_profiles_enabled_(false), |
| 48 test_session_state_delegate_(NULL) { | 56 test_session_state_delegate_(NULL) { |
| 49 } | 57 } |
| 50 | 58 |
| 51 TestShellDelegate::~TestShellDelegate() { | 59 TestShellDelegate::~TestShellDelegate() { |
| 52 } | 60 } |
| (...skipping 61 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 // The ContextFactory must exist before any Compositors are created. | 148 // The ContextFactory must exist before any Compositors are created. |
| 146 bool allow_test_contexts = true; | 149 bool allow_test_contexts = true; |
| 147 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); | 150 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); |
| 148 | 151 |
| 149 return RootWindowHostFactory::Create(); | 152 return RootWindowHostFactory::Create(); |
| 150 } | 153 } |
| 151 | 154 |
| 152 base::string16 TestShellDelegate::GetProductName() const { | 155 base::string16 TestShellDelegate::GetProductName() const { |
| 153 return base::string16(); | 156 return base::string16(); |
| 154 } | 157 } |
| 155 | 158 |
| 156 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { | 159 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { |
| 157 return test_session_state_delegate_; | 160 return test_session_state_delegate_; |
| 158 } | 161 } |
| 159 | 162 |
| 160 } // namespace test | 163 } // namespace test |
| 161 } // namespace ash | 164 } // namespace ash |
| OLD | NEW |