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

Side by Side Diff: chromecast/browser/cast_media_blocker.h

Issue 2535343003: [Chromecast] Simplify CastMediaBlocker. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | chromecast/browser/cast_media_blocker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_ 5 #ifndef CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_
6 #define CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_ 6 #define CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/public/browser/media_session_observer.h" 9 #include "content/public/browser/media_session_observer.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
11 11
12 namespace chromecast { 12 namespace chromecast {
13 namespace shell { 13 namespace shell {
14 14
15 // This class implements a blocking mode for web applications and is used in 15 // This class implements a blocking mode for web applications and is used in
16 // Chromecast internal code. Media is unblocked by default. 16 // Chromecast internal code. Media is unblocked by default.
17 // 17 class CastMediaBlocker : public content::MediaSessionObserver {
18 // TODO(derekjchow): Remove the inheritance from WebContentsObserver.
19 // See http://crbug.com/660331
20 class CastMediaBlocker : public content::MediaSessionObserver,
21 content::WebContentsObserver {
22 public: 18 public:
23 CastMediaBlocker(content::MediaSession* media_session, 19 explicit CastMediaBlocker(content::MediaSession* media_session);
24 content::WebContents* web_contents);
25 ~CastMediaBlocker() override; 20 ~CastMediaBlocker() override;
26 21
27 // Sets if the web contents is allowed to play media or not. If media is 22 // Sets if the web contents is allowed to play media or not. If media is
28 // unblocked, previously suspended elements should begin playing again. 23 // unblocked, previously suspended elements should begin playing again.
29 void BlockMediaLoading(bool blocked); 24 void BlockMediaLoading(bool blocked);
30 25
31 // content::MediaSessionObserver implementation: 26 // content::MediaSessionObserver implementation:
32 void MediaSessionStateChanged(bool is_controllable, 27 void MediaSessionStateChanged(bool is_controllable,
33 bool is_suspended) override; 28 bool is_suspended) override;
34 29
(...skipping 21 matching lines...) Expand all
56 bool suspended_; 51 bool suspended_;
57 bool controllable_; 52 bool controllable_;
58 53
59 DISALLOW_COPY_AND_ASSIGN(CastMediaBlocker); 54 DISALLOW_COPY_AND_ASSIGN(CastMediaBlocker);
60 }; 55 };
61 56
62 } // namespace shell 57 } // namespace shell
63 } // namespace chromecast 58 } // namespace chromecast
64 59
65 #endif // CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_ 60 #endif // CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_
OLDNEW
« no previous file with comments | « no previous file | chromecast/browser/cast_media_blocker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698