| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // invokes this method. If there are ongoing navigations, their respective | 312 // invokes this method. If there are ongoing navigations, their respective |
| 313 // failure methods will also be invoked. | 313 // failure methods will also be invoked. |
| 314 virtual void NavigationStopped() {} | 314 virtual void NavigationStopped() {} |
| 315 | 315 |
| 316 // This indicates that the next navigation was triggered by a user gesture. | 316 // This indicates that the next navigation was triggered by a user gesture. |
| 317 // TODO(dominickn): remove this method in favor of DidGetUserInteraction, | 317 // TODO(dominickn): remove this method in favor of DidGetUserInteraction, |
| 318 // with the appropriate filtering by input event type. | 318 // with the appropriate filtering by input event type. |
| 319 virtual void DidGetUserGesture() {} | 319 virtual void DidGetUserGesture() {} |
| 320 | 320 |
| 321 // Called when there has been direct user interaction with the WebContents. | 321 // Called when there has been direct user interaction with the WebContents. |
| 322 // Direct user input includes 1) any mouse down event; 2) any raw key down | 322 // The type argument specifies the kind of interaction. Direct user input |
| 323 // event; and 3) any gesture tap event (including taps and scrolls). | 323 // signalled through this callback includes: |
| 324 // 1) any mouse down event (blink::WebInputEvent::MouseDown); |
| 325 // 2) the start of a mouse wheel scroll (blink::WebInputEvent::MouseWheel); |
| 326 // 3) any raw key down event (blink::WebInputEvent::RawKeyDown); and |
| 327 // 4) any gesture tap event (blink::WebInputEvent::GestureTapDown). |
| 328 // The start of a mouse wheel scroll is heuristically detected: a mouse |
| 329 // wheel event fired at least 0.1 seconds after any other wheel event is |
| 330 // regarded as the beginning of a scroll. This matches the interval used by |
| 331 // the Blink EventHandler to detect the end of scrolls. |
| 324 virtual void DidGetUserInteraction(const blink::WebInputEvent::Type type) {} | 332 virtual void DidGetUserInteraction(const blink::WebInputEvent::Type type) {} |
| 325 | 333 |
| 326 // This method is invoked when a RenderViewHost of this WebContents was | 334 // This method is invoked when a RenderViewHost of this WebContents was |
| 327 // configured to ignore UI events, and an UI event took place. | 335 // configured to ignore UI events, and an UI event took place. |
| 328 virtual void DidGetIgnoredUIEvent() {} | 336 virtual void DidGetIgnoredUIEvent() {} |
| 329 | 337 |
| 330 // These methods are invoked every time the WebContents changes visibility. | 338 // These methods are invoked every time the WebContents changes visibility. |
| 331 virtual void WasShown() {} | 339 virtual void WasShown() {} |
| 332 virtual void WasHidden() {} | 340 virtual void WasHidden() {} |
| 333 | 341 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 void ResetWebContents(); | 471 void ResetWebContents(); |
| 464 | 472 |
| 465 WebContentsImpl* web_contents_; | 473 WebContentsImpl* web_contents_; |
| 466 | 474 |
| 467 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 475 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 468 }; | 476 }; |
| 469 | 477 |
| 470 } // namespace content | 478 } // namespace content |
| 471 | 479 |
| 472 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 480 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |