Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2410)

Unified Diff: ash/test/test_shell_delegate.cc

Issue 253183003: Media indicator for background recording task (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/test/test_shell_delegate.cc
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc
index 52962eeb472b927d803e2370affe18325472efe0..b0c13b0e94640051fd72395bfe8879ee172bc634 100644
--- a/ash/test/test_shell_delegate.cc
+++ b/ash/test/test_shell_delegate.cc
@@ -27,6 +27,10 @@
#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 {
@@ -44,9 +48,20 @@ class NewWindowDelegateImpl : public NewWindowDelegate {
class MediaDelegateImpl : public MediaDelegate {
public:
+ MediaDelegateImpl() : state_(MEDIA_CAPTURE_NONE) {}
+ virtual ~MediaDelegateImpl() {}
+
Mr4D (OOO till 08-26) 2014/04/30 18:24:36 .. overrides:
oshima 2014/04/30 20:40:31 fixed styles etc.
virtual void HandleMediaNextTrack() OVERRIDE {}
virtual void HandleMediaPlayPause() OVERRIDE {}
virtual void HandleMediaPrevTrack() OVERRIDE {}
+ virtual MediaCaptureState GetBackgroundMediaCaptureState(
+ content::BrowserContext* context) OVERRIDE {
+ return state_;
+ }
+ void set_media_capture_state(MediaCaptureState state) { state_ = state; }
+
+ private:
+ MediaCaptureState state_;
};
} // namespace
@@ -161,8 +176,14 @@ base::string16 TestShellDelegate::GetProductName() const {
return base::string16();
}
-TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() {
- return test_session_state_delegate_;
+void TestShellDelegate::SetBackgroundMediaCaptureState(
+ 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

Powered by Google App Engine
This is Rietveld 408576698