diff options
Diffstat (limited to 'ash/test/test_shell_delegate.cc')
-rw-r--r-- | ash/test/test_shell_delegate.cc | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index 52962ee..2a6597d 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -27,11 +27,21 @@ #include "ui/app_list/test/app_list_test_view_delegate.h" #include "ui/aura/window.h" +#if defined(OS_CHROMEOS) +#include "ash/system/tray/system_tray_notifier.h" +#endif + namespace ash { namespace test { namespace { class NewWindowDelegateImpl : public NewWindowDelegate { + public: + NewWindowDelegateImpl() {} + virtual ~NewWindowDelegateImpl() {} + + private: + // NewWindowDelegate: virtual void NewTab() OVERRIDE {} virtual void NewWindow(bool incognito) OVERRIDE {} virtual void OpenFileManager() OVERRIDE {} @@ -40,13 +50,30 @@ class NewWindowDelegateImpl : public NewWindowDelegate { virtual void ShowKeyboardOverlay() OVERRIDE {} virtual void ShowTaskManager() OVERRIDE {} virtual void OpenFeedbackPage() OVERRIDE {} + + DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl); }; class MediaDelegateImpl : public MediaDelegate { public: + MediaDelegateImpl() : state_(MEDIA_CAPTURE_NONE) {} + virtual ~MediaDelegateImpl() {} + + void set_media_capture_state(MediaCaptureState state) { state_ = state; } + + private: + // MediaDelegate: virtual void HandleMediaNextTrack() OVERRIDE {} virtual void HandleMediaPlayPause() OVERRIDE {} virtual void HandleMediaPrevTrack() OVERRIDE {} + virtual MediaCaptureState GetMediaCaptureState( + content::BrowserContext* context) OVERRIDE { + return state_; + } + + MediaCaptureState state_; + + DISALLOW_COPY_AND_ASSIGN(MediaDelegateImpl); }; } // namespace @@ -161,8 +188,13 @@ base::string16 TestShellDelegate::GetProductName() const { return base::string16(); } -TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { - return test_session_state_delegate_; +void TestShellDelegate::SetMediaCaptureState(MediaCaptureState state) { +#if defined(OS_CHROMEOS) + Shell* shell = Shell::GetInstance(); + static_cast<MediaDelegateImpl*>(shell->media_delegate()) + ->set_media_capture_state(state); + shell->system_tray_notifier()->NotifyMediaCaptureChanged(); +#endif } } // namespace test |