OLD | NEW |
---|---|
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/optional.h" | |
mlamouri (slow - plz ping)
2016/09/01 17:47:49
can't you forward declare `const T&`?
Zhiqiang Zhang (Slow)
2016/09/01 18:19:37
Sorry, I didn't quite follow here.
Do you mean for
Zhiqiang Zhang (Slow)
2016/09/02 12:11:41
Done.
| |
11 #include "base/process/kill.h" | 12 #include "base/process/kill.h" |
12 #include "base/process/process_handle.h" | 13 #include "base/process/process_handle.h" |
13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
14 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
15 #include "content/public/common/frame_navigate_params.h" | 16 #include "content/public/common/frame_navigate_params.h" |
16 #include "content/public/common/media_metadata.h" | 17 #include "content/public/common/media_metadata.h" |
17 #include "content/public/common/resource_type.h" | 18 #include "content/public/common/resource_type.h" |
18 #include "content/public/common/security_style.h" | 19 #include "content/public/common/security_style.h" |
19 #include "ipc/ipc_listener.h" | 20 #include "ipc/ipc_listener.h" |
20 #include "ipc/ipc_sender.h" | 21 #include "ipc/ipc_sender.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
462 // Invoked when media is playing or paused. |id| is unique per player and per | 463 // Invoked when media is playing or paused. |id| is unique per player and per |
463 // RenderFrameHost. There may be multiple players within a RenderFrameHost | 464 // RenderFrameHost. There may be multiple players within a RenderFrameHost |
464 // and subsequently within a WebContents. MediaStartedPlaying() will always | 465 // and subsequently within a WebContents. MediaStartedPlaying() will always |
465 // be followed by MediaStoppedPlaying() after player teardown. Observers must | 466 // be followed by MediaStoppedPlaying() after player teardown. Observers must |
466 // release all stored copies of |id| when MediaStoppedPlaying() is received. | 467 // release all stored copies of |id| when MediaStoppedPlaying() is received. |
467 using MediaPlayerId = std::pair<RenderFrameHost*, int>; | 468 using MediaPlayerId = std::pair<RenderFrameHost*, int>; |
468 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} | 469 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} |
469 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} | 470 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} |
470 | 471 |
471 // Invoked when media session has changed its state. | 472 // Invoked when media session has changed its state. |
472 virtual void MediaSessionStateChanged(bool is_controllable, | 473 virtual void MediaSessionStateChanged( |
473 bool is_suspended, | 474 bool is_controllable, |
474 const MediaMetadata& metadata) {} | 475 bool is_suspended, |
476 const base::Optional<MediaMetadata>& metadata) {} | |
475 | 477 |
476 // Invoked when the renderer process changes the page scale factor. | 478 // Invoked when the renderer process changes the page scale factor. |
477 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} | 479 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} |
478 | 480 |
479 // Invoked if an IPC message is coming from a specific RenderFrameHost. | 481 // Invoked if an IPC message is coming from a specific RenderFrameHost. |
480 virtual bool OnMessageReceived(const IPC::Message& message, | 482 virtual bool OnMessageReceived(const IPC::Message& message, |
481 RenderFrameHost* render_frame_host); | 483 RenderFrameHost* render_frame_host); |
482 | 484 |
483 // Notification that |contents| has gained focus. | 485 // Notification that |contents| has gained focus. |
484 virtual void OnWebContentsFocused() {} | 486 virtual void OnWebContentsFocused() {} |
(...skipping 28 matching lines...) Expand all Loading... | |
513 void ResetWebContents(); | 515 void ResetWebContents(); |
514 | 516 |
515 WebContentsImpl* web_contents_; | 517 WebContentsImpl* web_contents_; |
516 | 518 |
517 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 519 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
518 }; | 520 }; |
519 | 521 |
520 } // namespace content | 522 } // namespace content |
521 | 523 |
522 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 524 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |