Chromium Code Reviews| 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 { |
| 35 virtual void NewTab() OVERRIDE {} | 39 virtual void NewTab() OVERRIDE {} |
| 36 virtual void NewWindow(bool incognito) OVERRIDE {} | 40 virtual void NewWindow(bool incognito) OVERRIDE {} |
| 37 virtual void OpenFileManager() OVERRIDE {} | 41 virtual void OpenFileManager() OVERRIDE {} |
| 38 virtual void OpenCrosh() OVERRIDE {} | 42 virtual void OpenCrosh() OVERRIDE {} |
| 39 virtual void RestoreTab() OVERRIDE {} | 43 virtual void RestoreTab() OVERRIDE {} |
| 40 virtual void ShowKeyboardOverlay() OVERRIDE {} | 44 virtual void ShowKeyboardOverlay() OVERRIDE {} |
| 41 virtual void ShowTaskManager() OVERRIDE {} | 45 virtual void ShowTaskManager() OVERRIDE {} |
| 42 virtual void OpenFeedbackPage() OVERRIDE {} | 46 virtual void OpenFeedbackPage() OVERRIDE {} |
| 43 }; | 47 }; |
| 44 | 48 |
| 45 class MediaDelegateImpl : public MediaDelegate { | 49 class MediaDelegateImpl : public MediaDelegate { |
| 46 public: | 50 public: |
| 51 MediaDelegateImpl() : state_(MEDIA_CAPTURE_NONE) {} | |
| 52 virtual ~MediaDelegateImpl() {} | |
| 53 | |
|
Mr4D (OOO till 08-26)
2014/04/30 18:24:36
.. overrides:
oshima
2014/04/30 20:40:31
fixed styles etc.
| |
| 47 virtual void HandleMediaNextTrack() OVERRIDE {} | 54 virtual void HandleMediaNextTrack() OVERRIDE {} |
| 48 virtual void HandleMediaPlayPause() OVERRIDE {} | 55 virtual void HandleMediaPlayPause() OVERRIDE {} |
| 49 virtual void HandleMediaPrevTrack() OVERRIDE {} | 56 virtual void HandleMediaPrevTrack() OVERRIDE {} |
| 57 virtual MediaCaptureState GetBackgroundMediaCaptureState( | |
| 58 content::BrowserContext* context) OVERRIDE { | |
| 59 return state_; | |
| 60 } | |
| 61 void set_media_capture_state(MediaCaptureState state) { state_ = state; } | |
| 62 | |
| 63 private: | |
| 64 MediaCaptureState state_; | |
| 50 }; | 65 }; |
| 51 | 66 |
| 52 } // namespace | 67 } // namespace |
| 53 | 68 |
| 54 TestShellDelegate::TestShellDelegate() | 69 TestShellDelegate::TestShellDelegate() |
| 55 : num_exit_requests_(0), | 70 : num_exit_requests_(0), |
| 56 multi_profiles_enabled_(false), | 71 multi_profiles_enabled_(false), |
| 57 test_session_state_delegate_(NULL) { | 72 test_session_state_delegate_(NULL) { |
| 58 } | 73 } |
| 59 | 74 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 | 169 |
| 155 GPUSupport* TestShellDelegate::CreateGPUSupport() { | 170 GPUSupport* TestShellDelegate::CreateGPUSupport() { |
| 156 // Real GPU support depends on src/content, so just use a stub. | 171 // Real GPU support depends on src/content, so just use a stub. |
| 157 return new GPUSupportStub; | 172 return new GPUSupportStub; |
| 158 } | 173 } |
| 159 | 174 |
| 160 base::string16 TestShellDelegate::GetProductName() const { | 175 base::string16 TestShellDelegate::GetProductName() const { |
| 161 return base::string16(); | 176 return base::string16(); |
| 162 } | 177 } |
| 163 | 178 |
| 164 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { | 179 void TestShellDelegate::SetBackgroundMediaCaptureState( |
| 165 return test_session_state_delegate_; | 180 MediaCaptureState state) { |
| 181 #if defined(OS_CHROMEOS) | |
| 182 Shell* shell = Shell::GetInstance(); | |
| 183 static_cast<MediaDelegateImpl*>(shell->media_delegate()) | |
| 184 ->set_media_capture_state(state); | |
| 185 shell->system_tray_notifier()->NotifyMediaCaptureChanged(); | |
| 186 #endif | |
| 166 } | 187 } |
| 167 | 188 |
| 168 } // namespace test | 189 } // namespace test |
| 169 } // namespace ash | 190 } // namespace ash |
| OLD | NEW |