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

Side by Side Diff: ash/common/media_controller.h

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_COMMON_MEDIA_CONTROLLER_H_
6 #define ASH_COMMON_MEDIA_CONTROLLER_H_
7
8 #include "ash/public/interfaces/media.mojom.h"
9 #include "base/macros.h"
10 #include "base/observer_list.h"
11 #include "mojo/public/cpp/bindings/associated_binding.h"
12 #include "mojo/public/cpp/bindings/binding_set.h"
13
14 namespace ash {
15
16 // Forwards notifications from the MediaController to observers.
17 class MediaCaptureObserver {
18 public:
19 // Called when media capture state has changed.
20 virtual void OnMediaCaptureChanged(
21 const std::vector<mojom::MediaCaptureState>& capture_states) = 0;
22
23 protected:
24 virtual ~MediaCaptureObserver() {}
25 };
26
27 // Provides the MediaController interface to the outside world. This lets a
28 // consumer of ash provide a MediaClient, which we will dispatch to if one has
29 // been provided to us.
30 class MediaController : public mojom::MediaController,
31 public mojom::MediaClient {
32 public:
33 MediaController();
34 ~MediaController() override;
35
36 void BindRequest(mojom::MediaControllerRequest request);
37
38 void AddObserver(MediaCaptureObserver* observer);
39 void RemoveObserver(MediaCaptureObserver* observer);
40
41 // mojom::MediaClient:
42 void HandleMediaNextTrack() override;
43 void HandleMediaPlayPause() override;
44 void HandleMediaPrevTrack() override;
45 void RequestCaptureState() override;
46
47 private:
48 friend class MultiProfileMediaTrayItemTest;
49
50 // mojom::MediaController:
51 void SetClient(mojom::MediaClientAssociatedPtrInfo client) override;
52 void NotifyCaptureState(
53 const std::vector<mojom::MediaCaptureState>& capture_states) override;
54
55 mojo::BindingSet<mojom::MediaController> bindings_;
56
57 mojom::MediaClientAssociatedPtr client_;
58
59 base::ObserverList<MediaCaptureObserver> observers_;
60
61 DISALLOW_COPY_AND_ASSIGN(MediaController);
62 };
63
64 } // namespace ash
65
66 #endif // ASH_COMMON_MEDIA_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/common/material_design/material_design_controller.cc ('k') | ash/common/media_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698