| 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 "base/process/kill.h" | 8 #include "base/process/kill.h" |
| 9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // Invoked when a user cancels a before unload dialog. | 417 // Invoked when a user cancels a before unload dialog. |
| 418 virtual void BeforeUnloadDialogCancelled() {} | 418 virtual void BeforeUnloadDialogCancelled() {} |
| 419 | 419 |
| 420 // Invoked when an accessibility event is received from the renderer process. | 420 // Invoked when an accessibility event is received from the renderer process. |
| 421 virtual void AccessibilityEventReceived( | 421 virtual void AccessibilityEventReceived( |
| 422 const std::vector<AXEventNotificationDetails>& details) {} | 422 const std::vector<AXEventNotificationDetails>& details) {} |
| 423 | 423 |
| 424 // Invoked when theme color is changed to |theme_color|. | 424 // Invoked when theme color is changed to |theme_color|. |
| 425 virtual void DidChangeThemeColor(SkColor theme_color) {} | 425 virtual void DidChangeThemeColor(SkColor theme_color) {} |
| 426 | 426 |
| 427 // Invoked when media is playing. | 427 // Invoked when media is playing or paused. |id| is unique per player and per |
| 428 virtual void MediaStartedPlaying() {} | 428 // RenderFrameHost. There may be multiple players within a RenderFrameHost |
| 429 | 429 // and subsequently within a WebContents. MediaStartedPlaying() will always |
| 430 // Invoked when media is paused. | 430 // be followed by MediaStoppedPlaying() after player teardown. Observers must |
| 431 virtual void MediaPaused() {} | 431 // release all stored copies of |id| when MediaStoppedPlaying() is received. |
| 432 using MediaPlayerId = std::pair<RenderFrameHost*, int64_t>; |
| 433 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} |
| 434 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} |
| 432 | 435 |
| 433 // Invoked when media session has changed its state. | 436 // Invoked when media session has changed its state. |
| 434 virtual void MediaSessionStateChanged(bool is_controllable, | 437 virtual void MediaSessionStateChanged(bool is_controllable, |
| 435 bool is_suspended) {} | 438 bool is_suspended) {} |
| 436 | 439 |
| 437 // Invoked when the renderer process changes the page scale factor. | 440 // Invoked when the renderer process changes the page scale factor. |
| 438 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} | 441 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} |
| 439 | 442 |
| 440 // Invoked if an IPC message is coming from a specific RenderFrameHost. | 443 // Invoked if an IPC message is coming from a specific RenderFrameHost. |
| 441 virtual bool OnMessageReceived(const IPC::Message& message, | 444 virtual bool OnMessageReceived(const IPC::Message& message, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 void ResetWebContents(); | 477 void ResetWebContents(); |
| 475 | 478 |
| 476 WebContentsImpl* web_contents_; | 479 WebContentsImpl* web_contents_; |
| 477 | 480 |
| 478 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 481 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 479 }; | 482 }; |
| 480 | 483 |
| 481 } // namespace content | 484 } // namespace content |
| 482 | 485 |
| 483 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 486 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |