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

Side by Side Diff: content/public/browser/web_contents_observer.h

Issue 2300083002: Wrap MediaMetadata in base::Optional in content and chrome (Closed)
Patch Set: addressed Mounir's comments Created 4 years, 3 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 (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"
11 #include "base/process/kill.h" 11 #include "base/process/kill.h"
12 #include "base/process/process_handle.h" 12 #include "base/process/process_handle.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "content/public/browser/navigation_controller.h" 14 #include "content/public/browser/navigation_controller.h"
15 #include "content/public/common/frame_navigate_params.h" 15 #include "content/public/common/frame_navigate_params.h"
16 #include "content/public/common/media_metadata.h"
17 #include "content/public/common/resource_type.h" 16 #include "content/public/common/resource_type.h"
18 #include "content/public/common/security_style.h" 17 #include "content/public/common/security_style.h"
19 #include "ipc/ipc_listener.h" 18 #include "ipc/ipc_listener.h"
20 #include "ipc/ipc_sender.h" 19 #include "ipc/ipc_sender.h"
21 #include "third_party/WebKit/public/web/WebInputEvent.h" 20 #include "third_party/WebKit/public/web/WebInputEvent.h"
22 #include "third_party/skia/include/core/SkColor.h" 21 #include "third_party/skia/include/core/SkColor.h"
23 #include "ui/base/page_transition_types.h" 22 #include "ui/base/page_transition_types.h"
24 #include "ui/base/window_open_disposition.h" 23 #include "ui/base/window_open_disposition.h"
25 24
25 namespace base {
26 template <typename T> class Optional;
27 } // namespace base
28
26 namespace content { 29 namespace content {
27 30
28 class NavigationEntry; 31 class NavigationEntry;
29 class NavigationHandle; 32 class NavigationHandle;
30 class RenderFrameHost; 33 class RenderFrameHost;
31 class RenderViewHost; 34 class RenderViewHost;
32 class RenderWidgetHost; 35 class RenderWidgetHost;
33 class WebContents; 36 class WebContents;
34 class WebContentsImpl; 37 class WebContentsImpl;
35 struct AXEventNotificationDetails; 38 struct AXEventNotificationDetails;
36 struct AXLocationChangeNotificationDetails; 39 struct AXLocationChangeNotificationDetails;
37 struct FaviconURL; 40 struct FaviconURL;
38 struct FrameNavigateParams; 41 struct FrameNavigateParams;
39 struct LoadCommittedDetails; 42 struct LoadCommittedDetails;
43 struct MediaMetadata;
40 struct Referrer; 44 struct Referrer;
41 struct ResourceRedirectDetails; 45 struct ResourceRedirectDetails;
42 struct ResourceRequestDetails; 46 struct ResourceRequestDetails;
43 struct SecurityStyleExplanations; 47 struct SecurityStyleExplanations;
44 48
45 // An observer API implemented by classes which are interested in various page 49 // An observer API implemented by classes which are interested in various page
46 // load events from WebContents. They also get a chance to filter IPC messages. 50 // load events from WebContents. They also get a chance to filter IPC messages.
47 // 51 //
48 // Since a WebContents can be a delegate to almost arbitrarily many 52 // Since a WebContents can be a delegate to almost arbitrarily many
49 // RenderViewHosts, it is important to check in those WebContentsObserver 53 // RenderViewHosts, it is important to check in those WebContentsObserver
(...skipping 412 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 466 // Invoked when media is playing or paused. |id| is unique per player and per
463 // RenderFrameHost. There may be multiple players within a RenderFrameHost 467 // RenderFrameHost. There may be multiple players within a RenderFrameHost
464 // and subsequently within a WebContents. MediaStartedPlaying() will always 468 // and subsequently within a WebContents. MediaStartedPlaying() will always
465 // be followed by MediaStoppedPlaying() after player teardown. Observers must 469 // be followed by MediaStoppedPlaying() after player teardown. Observers must
466 // release all stored copies of |id| when MediaStoppedPlaying() is received. 470 // release all stored copies of |id| when MediaStoppedPlaying() is received.
467 using MediaPlayerId = std::pair<RenderFrameHost*, int>; 471 using MediaPlayerId = std::pair<RenderFrameHost*, int>;
468 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} 472 virtual void MediaStartedPlaying(const MediaPlayerId& id) {}
469 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} 473 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {}
470 474
471 // Invoked when media session has changed its state. 475 // Invoked when media session has changed its state.
472 virtual void MediaSessionStateChanged(bool is_controllable, 476 virtual void MediaSessionStateChanged(
473 bool is_suspended, 477 bool is_controllable,
474 const MediaMetadata& metadata) {} 478 bool is_suspended,
479 const base::Optional<MediaMetadata>& metadata) {}
475 480
476 // Invoked when the renderer process changes the page scale factor. 481 // Invoked when the renderer process changes the page scale factor.
477 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} 482 virtual void OnPageScaleFactorChanged(float page_scale_factor) {}
478 483
479 // Invoked if an IPC message is coming from a specific RenderFrameHost. 484 // Invoked if an IPC message is coming from a specific RenderFrameHost.
480 virtual bool OnMessageReceived(const IPC::Message& message, 485 virtual bool OnMessageReceived(const IPC::Message& message,
481 RenderFrameHost* render_frame_host); 486 RenderFrameHost* render_frame_host);
482 487
483 // Notification that |contents| has gained focus. 488 // Notification that |contents| has gained focus.
484 virtual void OnWebContentsFocused() {} 489 virtual void OnWebContentsFocused() {}
(...skipping 28 matching lines...) Expand all
513 void ResetWebContents(); 518 void ResetWebContents();
514 519
515 WebContentsImpl* web_contents_; 520 WebContentsImpl* web_contents_;
516 521
517 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); 522 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver);
518 }; 523 };
519 524
520 } // namespace content 525 } // namespace content
521 526
522 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 527 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698