| 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/default_accessibility_delegate.h" | 9 #include "ash/default_accessibility_delegate.h" |
| 10 #include "ash/gpu_support_stub.h" | 10 #include "ash/gpu_support_stub.h" |
| 11 #include "ash/media_delegate.h" | 11 #include "ash/media_delegate.h" |
| 12 #include "ash/new_window_delegate.h" | 12 #include "ash/new_window_delegate.h" |
| 13 #include "ash/session/session_state_delegate.h" | 13 #include "ash/session/session_state_delegate.h" |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/shell/keyboard_controller_proxy_stub.h" | 15 #include "ash/shell/keyboard_controller_proxy_stub.h" |
| 16 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
| 17 #include "ash/test/test_session_state_delegate.h" | 17 #include "ash/test/test_session_state_delegate.h" |
| 18 #include "ash/test/test_shelf_delegate.h" | 18 #include "ash/test/test_shelf_delegate.h" |
| 19 #include "ash/test/test_system_tray_delegate.h" | 19 #include "ash/test/test_system_tray_delegate.h" |
| 20 #include "ash/test/test_user_wallpaper_delegate.h" | 20 #include "ash/test/test_user_wallpaper_delegate.h" |
| 21 #include "ash/wm/window_state.h" | 21 #include "ash/wm/window_state.h" |
| 22 #include "ash/wm/window_util.h" | 22 #include "ash/wm/window_util.h" |
| 23 #include "base/logging.h" | 23 #include "base/logging.h" |
| 24 #include "content/public/test/test_browser_context.h" | 24 #include "content/public/test/test_browser_context.h" |
| 25 #include "ui/app_list/app_list_model.h" | 25 #include "ui/app_list/app_list_model.h" |
| 26 #include "ui/app_list/app_list_view_delegate.h" | 26 #include "ui/app_list/app_list_view_delegate.h" |
| 27 #include "ui/app_list/test/app_list_test_view_delegate.h" | 27 #include "ui/app_list/test/app_list_test_view_delegate.h" |
| 28 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
| 29 | 29 |
| 30 #if defined(OS_CHROMEOS) |
| 31 #include "ash/system/tray/system_tray_notifier.h" |
| 32 #endif |
| 33 |
| 30 namespace ash { | 34 namespace ash { |
| 31 namespace test { | 35 namespace test { |
| 32 namespace { | 36 namespace { |
| 33 | 37 |
| 34 class NewWindowDelegateImpl : public NewWindowDelegate { | 38 class NewWindowDelegateImpl : public NewWindowDelegate { |
| 39 public: |
| 40 NewWindowDelegateImpl() {} |
| 41 virtual ~NewWindowDelegateImpl() {} |
| 42 |
| 43 private: |
| 44 // NewWindowDelegate: |
| 35 virtual void NewTab() OVERRIDE {} | 45 virtual void NewTab() OVERRIDE {} |
| 36 virtual void NewWindow(bool incognito) OVERRIDE {} | 46 virtual void NewWindow(bool incognito) OVERRIDE {} |
| 37 virtual void OpenFileManager() OVERRIDE {} | 47 virtual void OpenFileManager() OVERRIDE {} |
| 38 virtual void OpenCrosh() OVERRIDE {} | 48 virtual void OpenCrosh() OVERRIDE {} |
| 39 virtual void RestoreTab() OVERRIDE {} | 49 virtual void RestoreTab() OVERRIDE {} |
| 40 virtual void ShowKeyboardOverlay() OVERRIDE {} | 50 virtual void ShowKeyboardOverlay() OVERRIDE {} |
| 41 virtual void ShowTaskManager() OVERRIDE {} | 51 virtual void ShowTaskManager() OVERRIDE {} |
| 42 virtual void OpenFeedbackPage() OVERRIDE {} | 52 virtual void OpenFeedbackPage() OVERRIDE {} |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl); |
| 43 }; | 55 }; |
| 44 | 56 |
| 45 class MediaDelegateImpl : public MediaDelegate { | 57 class MediaDelegateImpl : public MediaDelegate { |
| 46 public: | 58 public: |
| 59 MediaDelegateImpl() : state_(MEDIA_CAPTURE_NONE) {} |
| 60 virtual ~MediaDelegateImpl() {} |
| 61 |
| 62 void set_media_capture_state(MediaCaptureState state) { state_ = state; } |
| 63 |
| 64 private: |
| 65 // MediaDelegate: |
| 47 virtual void HandleMediaNextTrack() OVERRIDE {} | 66 virtual void HandleMediaNextTrack() OVERRIDE {} |
| 48 virtual void HandleMediaPlayPause() OVERRIDE {} | 67 virtual void HandleMediaPlayPause() OVERRIDE {} |
| 49 virtual void HandleMediaPrevTrack() OVERRIDE {} | 68 virtual void HandleMediaPrevTrack() OVERRIDE {} |
| 69 virtual MediaCaptureState GetMediaCaptureState( |
| 70 content::BrowserContext* context) OVERRIDE { |
| 71 return state_; |
| 72 } |
| 73 |
| 74 MediaCaptureState state_; |
| 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(MediaDelegateImpl); |
| 50 }; | 77 }; |
| 51 | 78 |
| 52 } // namespace | 79 } // namespace |
| 53 | 80 |
| 54 TestShellDelegate::TestShellDelegate() | 81 TestShellDelegate::TestShellDelegate() |
| 55 : num_exit_requests_(0), | 82 : num_exit_requests_(0), |
| 56 multi_profiles_enabled_(false), | 83 multi_profiles_enabled_(false), |
| 57 test_session_state_delegate_(NULL) { | 84 test_session_state_delegate_(NULL) { |
| 58 } | 85 } |
| 59 | 86 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 181 |
| 155 GPUSupport* TestShellDelegate::CreateGPUSupport() { | 182 GPUSupport* TestShellDelegate::CreateGPUSupport() { |
| 156 // Real GPU support depends on src/content, so just use a stub. | 183 // Real GPU support depends on src/content, so just use a stub. |
| 157 return new GPUSupportStub; | 184 return new GPUSupportStub; |
| 158 } | 185 } |
| 159 | 186 |
| 160 base::string16 TestShellDelegate::GetProductName() const { | 187 base::string16 TestShellDelegate::GetProductName() const { |
| 161 return base::string16(); | 188 return base::string16(); |
| 162 } | 189 } |
| 163 | 190 |
| 164 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { | 191 void TestShellDelegate::SetMediaCaptureState(MediaCaptureState state) { |
| 165 return test_session_state_delegate_; | 192 #if defined(OS_CHROMEOS) |
| 193 Shell* shell = Shell::GetInstance(); |
| 194 static_cast<MediaDelegateImpl*>(shell->media_delegate()) |
| 195 ->set_media_capture_state(state); |
| 196 shell->system_tray_notifier()->NotifyMediaCaptureChanged(); |
| 197 #endif |
| 166 } | 198 } |
| 167 | 199 |
| 168 } // namespace test | 200 } // namespace test |
| 169 } // namespace ash | 201 } // namespace ash |
| OLD | NEW |