| 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/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" |
| 16 #include "content/public/common/security_style.h" | 17 #include "content/public/common/security_style.h" |
| 17 #include "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
| 18 #include "ipc/ipc_sender.h" | 19 #include "ipc/ipc_sender.h" |
| 19 #include "third_party/WebKit/public/web/WebInputEvent.h" | 20 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 20 #include "third_party/skia/include/core/SkColor.h" | 21 #include "third_party/skia/include/core/SkColor.h" |
| 21 #include "ui/base/page_transition_types.h" | 22 #include "ui/base/page_transition_types.h" |
| 22 #include "ui/base/window_open_disposition.h" | 23 #include "ui/base/window_open_disposition.h" |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 | 26 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 // RenderFrameHost. There may be multiple players within a RenderFrameHost | 437 // RenderFrameHost. There may be multiple players within a RenderFrameHost |
| 437 // and subsequently within a WebContents. MediaStartedPlaying() will always | 438 // and subsequently within a WebContents. MediaStartedPlaying() will always |
| 438 // be followed by MediaStoppedPlaying() after player teardown. Observers must | 439 // be followed by MediaStoppedPlaying() after player teardown. Observers must |
| 439 // release all stored copies of |id| when MediaStoppedPlaying() is received. | 440 // release all stored copies of |id| when MediaStoppedPlaying() is received. |
| 440 using MediaPlayerId = std::pair<RenderFrameHost*, int>; | 441 using MediaPlayerId = std::pair<RenderFrameHost*, int>; |
| 441 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} | 442 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} |
| 442 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} | 443 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} |
| 443 | 444 |
| 444 // Invoked when media session has changed its state. | 445 // Invoked when media session has changed its state. |
| 445 virtual void MediaSessionStateChanged(bool is_controllable, | 446 virtual void MediaSessionStateChanged(bool is_controllable, |
| 446 bool is_suspended) {} | 447 bool is_suspended, |
| 448 const MediaMetadata& metadata) {} |
| 447 | 449 |
| 448 // Invoked when the renderer process changes the page scale factor. | 450 // Invoked when the renderer process changes the page scale factor. |
| 449 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} | 451 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} |
| 450 | 452 |
| 451 // Invoked if an IPC message is coming from a specific RenderFrameHost. | 453 // Invoked if an IPC message is coming from a specific RenderFrameHost. |
| 452 virtual bool OnMessageReceived(const IPC::Message& message, | 454 virtual bool OnMessageReceived(const IPC::Message& message, |
| 453 RenderFrameHost* render_frame_host); | 455 RenderFrameHost* render_frame_host); |
| 454 | 456 |
| 455 // Notification that |contents| has gained focus. | 457 // Notification that |contents| has gained focus. |
| 456 virtual void OnWebContentsFocused() {} | 458 virtual void OnWebContentsFocused() {} |
| (...skipping 28 matching lines...) Expand all Loading... |
| 485 void ResetWebContents(); | 487 void ResetWebContents(); |
| 486 | 488 |
| 487 WebContentsImpl* web_contents_; | 489 WebContentsImpl* web_contents_; |
| 488 | 490 |
| 489 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 491 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 490 }; | 492 }; |
| 491 | 493 |
| 492 } // namespace content | 494 } // namespace content |
| 493 | 495 |
| 494 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 496 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |