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

Unified Diff: chrome/browser/ui/ash/media_client.h

Issue 2563643003: mash: Change the MediaDelegate to a Media{Controller,Client}. (Closed)
Patch Set: Comment fixes Created 4 years 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
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/browser/ui/ash/media_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/media_client.h
diff --git a/chrome/browser/ui/ash/media_client.h b/chrome/browser/ui/ash/media_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..cfcc72dbc817746530c23a14a81200de96b3c0b4
--- /dev/null
+++ b/chrome/browser/ui/ash/media_client.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ASH_MEDIA_CLIENT_H_
+#define CHROME_BROWSER_UI_ASH_MEDIA_CLIENT_H_
+
+#include "ash/public/interfaces/media.mojom.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
+
+class MediaClient : public ash::mojom::MediaClient,
+ MediaCaptureDevicesDispatcher::Observer {
+ public:
+ MediaClient();
+ ~MediaClient() override;
+
+ // ash::MediaClient:
+ void HandleMediaNextTrack() override;
+ void HandleMediaPlayPause() override;
+ void HandleMediaPrevTrack() override;
+ void RequestCaptureState() override;
+
+ // MediaCaptureDevicesDispatcher::Observer:
+ void OnRequestUpdate(int render_process_id,
+ int render_frame_id,
+ content::MediaStreamType stream_type,
+ const content::MediaRequestState state) override;
+
+ private:
+ // Returns the media capture state for the current user at
+ // |user_index|. (Note that this isn't stable, see implementation comment on
+ // RequestCaptureState()).
+ ash::mojom::MediaCaptureState GetMediaCaptureStateByIndex(int user_index);
+
+ ash::mojom::MediaControllerPtr media_controller_;
+
+ mojo::AssociatedBinding<ash::mojom::MediaClient> binding_;
+
+ base::WeakPtrFactory<MediaClient> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaClient);
+};
+
+#endif // CHROME_BROWSER_UI_ASH_MEDIA_CLIENT_H_
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/browser/ui/ash/media_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698