| 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" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 310 |
| 311 // This method is invoked when the renderer process has completed its first | 311 // This method is invoked when the renderer process has completed its first |
| 312 // paint after a non-empty layout. | 312 // paint after a non-empty layout. |
| 313 virtual void DidFirstVisuallyNonEmptyPaint() {} | 313 virtual void DidFirstVisuallyNonEmptyPaint() {} |
| 314 | 314 |
| 315 // When WebContents::Stop() is called, the WebContents stops loading and then | 315 // When WebContents::Stop() is called, the WebContents stops loading and then |
| 316 // invokes this method. If there are ongoing navigations, their respective | 316 // invokes this method. If there are ongoing navigations, their respective |
| 317 // failure methods will also be invoked. | 317 // failure methods will also be invoked. |
| 318 virtual void NavigationStopped() {} | 318 virtual void NavigationStopped() {} |
| 319 | 319 |
| 320 // This indicates that the next navigation was triggered by a user gesture. | |
| 321 // TODO(dominickn): remove this method in favor of DidGetUserInteraction, | |
| 322 // with the appropriate filtering by input event type. | |
| 323 virtual void DidGetUserGesture() {} | |
| 324 | |
| 325 // Called when there has been direct user interaction with the WebContents. | 320 // Called when there has been direct user interaction with the WebContents. |
| 326 // The type argument specifies the kind of interaction. Direct user input | 321 // The type argument specifies the kind of interaction. Direct user input |
| 327 // signalled through this callback includes: | 322 // signalled through this callback includes: |
| 328 // 1) any mouse down event (blink::WebInputEvent::MouseDown); | 323 // 1) any mouse down event (blink::WebInputEvent::MouseDown); |
| 329 // 2) the start of a mouse wheel scroll (blink::WebInputEvent::MouseWheel); | 324 // 2) the start of a mouse wheel scroll (blink::WebInputEvent::MouseWheel); |
| 330 // 3) any raw key down event (blink::WebInputEvent::RawKeyDown); and | 325 // 3) any raw key down event (blink::WebInputEvent::RawKeyDown); |
| 331 // 4) any gesture tap event (blink::WebInputEvent::GestureTapDown). | 326 // 4) any gesture tap event (blink::WebInputEvent::GestureTapDown); and |
| 327 // 5) a browser navigation or reload (blink::WebInputEvent::Undefined). |
| 332 // The start of a mouse wheel scroll is heuristically detected: a mouse | 328 // The start of a mouse wheel scroll is heuristically detected: a mouse |
| 333 // wheel event fired at least 0.1 seconds after any other wheel event is | 329 // wheel event fired at least 0.1 seconds after any other wheel event is |
| 334 // regarded as the beginning of a scroll. This matches the interval used by | 330 // regarded as the beginning of a scroll. This matches the interval used by |
| 335 // the Blink EventHandler to detect the end of scrolls. | 331 // the Blink EventHandler to detect the end of scrolls. |
| 332 // TODO(dominickn): replace MouseWheel with GestureScrollBegin. |
| 336 virtual void DidGetUserInteraction(const blink::WebInputEvent::Type type) {} | 333 virtual void DidGetUserInteraction(const blink::WebInputEvent::Type type) {} |
| 337 | 334 |
| 338 // This method is invoked when a RenderViewHost of this WebContents was | 335 // This method is invoked when a RenderViewHost of this WebContents was |
| 339 // configured to ignore UI events, and an UI event took place. | 336 // configured to ignore UI events, and an UI event took place. |
| 340 virtual void DidGetIgnoredUIEvent() {} | 337 virtual void DidGetIgnoredUIEvent() {} |
| 341 | 338 |
| 342 // These methods are invoked every time the WebContents changes visibility. | 339 // These methods are invoked every time the WebContents changes visibility. |
| 343 virtual void WasShown() {} | 340 virtual void WasShown() {} |
| 344 virtual void WasHidden() {} | 341 virtual void WasHidden() {} |
| 345 | 342 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 void ResetWebContents(); | 482 void ResetWebContents(); |
| 486 | 483 |
| 487 WebContentsImpl* web_contents_; | 484 WebContentsImpl* web_contents_; |
| 488 | 485 |
| 489 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 486 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 490 }; | 487 }; |
| 491 | 488 |
| 492 } // namespace content | 489 } // namespace content |
| 493 | 490 |
| 494 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 491 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |