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

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

Issue 2411723002: Split MediaSessionStateChanged() and MediaSessionMetadataChanged() (Closed)
Patch Set: rebased Created 4 years, 2 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
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/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 10
(...skipping 23 matching lines...) Expand all
34 virtual void UpdateMediaBlockedState(); 34 virtual void UpdateMediaBlockedState();
35 35
36 private: 36 private:
37 enum BlockState { 37 enum BlockState {
38 BLOCKED, // All media playback should be blocked. 38 BLOCKED, // All media playback should be blocked.
39 UNBLOCKING, // Media playback should be resumed at next oppurtunity. 39 UNBLOCKING, // Media playback should be resumed at next oppurtunity.
40 UNBLOCKED, // Media playback should not be blocked. 40 UNBLOCKED, // Media playback should not be blocked.
41 }; 41 };
42 42
43 // content::WebContentsObserver implementation: 43 // content::WebContentsObserver implementation:
44 void MediaSessionStateChanged( 44 void MediaSessionStateChanged(bool is_controllable,
45 bool is_controllable, 45 bool is_suspended) override;
46 bool is_suspended,
47 const base::Optional<content::MediaMetadata>& metadata) override;
48 46
49 // Whether or not media in the app can be controlled and if media is currently 47 // Whether or not media in the app can be controlled and if media is currently
50 // suspended. These variables cache arguments from MediaSessionStateChanged(). 48 // suspended. These variables cache arguments from MediaSessionStateChanged().
51 bool controllable_; 49 bool controllable_;
52 bool suspended_; 50 bool suspended_;
53 51
54 BlockState state_; 52 BlockState state_;
55 53
56 DISALLOW_COPY_AND_ASSIGN(CastMediaBlocker); 54 DISALLOW_COPY_AND_ASSIGN(CastMediaBlocker);
57 }; 55 };
58 56
59 } // namespace shell 57 } // namespace shell
60 } // namespace chromecast 58 } // namespace chromecast
61 59
62 #endif // CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_ 60 #endif // CHROMECAST_BROWSER_CAST_MEDIA_BLOCKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698