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

Side by Side Diff: content/public/browser/web_contents_observer.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
« no previous file with comments | « content/public/android/java/src/org/chromium/content_public/browser/WebContentsObserver.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 // Invoked when media is playing or paused. |id| is unique per player and per 462 // Invoked when media is playing or paused. |id| is unique per player and per
463 // RenderFrameHost. There may be multiple players within a RenderFrameHost 463 // RenderFrameHost. There may be multiple players within a RenderFrameHost
464 // and subsequently within a WebContents. MediaStartedPlaying() will always 464 // and subsequently within a WebContents. MediaStartedPlaying() will always
465 // be followed by MediaStoppedPlaying() after player teardown. Observers must 465 // be followed by MediaStoppedPlaying() after player teardown. Observers must
466 // release all stored copies of |id| when MediaStoppedPlaying() is received. 466 // release all stored copies of |id| when MediaStoppedPlaying() is received.
467 using MediaPlayerId = std::pair<RenderFrameHost*, int>; 467 using MediaPlayerId = std::pair<RenderFrameHost*, int>;
468 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} 468 virtual void MediaStartedPlaying(const MediaPlayerId& id) {}
469 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} 469 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {}
470 470
471 // Invoked when media session has changed its state. 471 // Invoked when media session has changed its state.
472 virtual void MediaSessionStateChanged( 472 virtual void MediaSessionStateChanged(bool is_controllable,
473 bool is_controllable, 473 bool is_suspended) {}
474 bool is_suspended, 474
475 // Invoked when media session metadata has changed. When |metadata| is
476 // nullopt, it means the metadata is being unset.
477 virtual void MediaSessionMetadataChanged(
475 const base::Optional<MediaMetadata>& metadata) {} 478 const base::Optional<MediaMetadata>& metadata) {}
476 479
477 // Invoked when the renderer process changes the page scale factor. 480 // Invoked when the renderer process changes the page scale factor.
478 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} 481 virtual void OnPageScaleFactorChanged(float page_scale_factor) {}
479 482
480 // Invoked if an IPC message is coming from a specific RenderFrameHost. 483 // Invoked if an IPC message is coming from a specific RenderFrameHost.
481 virtual bool OnMessageReceived(const IPC::Message& message, 484 virtual bool OnMessageReceived(const IPC::Message& message,
482 RenderFrameHost* render_frame_host); 485 RenderFrameHost* render_frame_host);
483 486
484 // Notification that |contents| has gained focus. 487 // Notification that |contents| has gained focus.
(...skipping 29 matching lines...) Expand all
514 void ResetWebContents(); 517 void ResetWebContents();
515 518
516 WebContentsImpl* web_contents_; 519 WebContentsImpl* web_contents_;
517 520
518 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); 521 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver);
519 }; 522 };
520 523
521 } // namespace content 524 } // namespace content
522 525
523 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 526 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content_public/browser/WebContentsObserver.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698