| 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // (on Windows); | 340 // (on Windows); |
| 341 // * when it receives a "commit" signal of GtkIMContext (on Linux); | 341 // * when it receives a "commit" signal of GtkIMContext (on Linux); |
| 342 // * when insertText of NSTextInput is called (on Mac). | 342 // * when insertText of NSTextInput is called (on Mac). |
| 343 void ImeConfirmComposition(const base::string16& text, | 343 void ImeConfirmComposition(const base::string16& text, |
| 344 const gfx::Range& replacement_range, | 344 const gfx::Range& replacement_range, |
| 345 bool keep_selection); | 345 bool keep_selection); |
| 346 | 346 |
| 347 // Cancels an ongoing composition. | 347 // Cancels an ongoing composition. |
| 348 void ImeCancelComposition(); | 348 void ImeCancelComposition(); |
| 349 | 349 |
| 350 // This is for derived classes to give us access to the resizer rect. | |
| 351 // And to also expose it to the RenderWidgetHostView. | |
| 352 virtual gfx::Rect GetRootWindowResizerRect() const; | |
| 353 | |
| 354 bool ignore_input_events() const { | 350 bool ignore_input_events() const { |
| 355 return ignore_input_events_; | 351 return ignore_input_events_; |
| 356 } | 352 } |
| 357 | 353 |
| 358 // Whether forwarded WebInputEvents should be ignored. True if either | 354 // Whether forwarded WebInputEvents should be ignored. True if either |
| 359 // |ignore_input_events_| or |process_->IgnoreInputEvents()| is true. | 355 // |ignore_input_events_| or |process_->IgnoreInputEvents()| is true. |
| 360 bool IgnoreInputEvents() const; | 356 bool IgnoreInputEvents() const; |
| 361 | 357 |
| 362 bool has_touch_handler() const { return has_touch_handler_; } | 358 bool has_touch_handler() const { return has_touch_handler_; } |
| 363 | 359 |
| 364 // Notification that the user has made some kind of input that could | |
| 365 // perform an action. See OnUserGesture for more details. | |
| 366 void StartUserGesture(); | |
| 367 | |
| 368 // Set the RenderView background transparency. | 360 // Set the RenderView background transparency. |
| 369 void SetBackgroundOpaque(bool opaque); | 361 void SetBackgroundOpaque(bool opaque); |
| 370 | 362 |
| 371 // Notifies the renderer that the next key event is bound to one or more | 363 // Notifies the renderer that the next key event is bound to one or more |
| 372 // pre-defined edit commands | 364 // pre-defined edit commands |
| 373 void SetEditCommandsForNextKeyEvent( | 365 void SetEditCommandsForNextKeyEvent( |
| 374 const std::vector<EditCommand>& commands); | 366 const std::vector<EditCommand>& commands); |
| 375 | 367 |
| 376 // Executes the edit command on the RenderView. | 368 // Executes the edit command on the RenderView. |
| 377 void ExecuteEditCommand(const std::string& command, | 369 void ExecuteEditCommand(const std::string& command, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 // This is used for various IPC messages, including plugins. | 505 // This is used for various IPC messages, including plugins. |
| 514 gfx::NativeViewId GetNativeViewId() const; | 506 gfx::NativeViewId GetNativeViewId() const; |
| 515 | 507 |
| 516 // --------------------------------------------------------------------------- | 508 // --------------------------------------------------------------------------- |
| 517 // The following methods are overridden by RenderViewHost to send upwards to | 509 // The following methods are overridden by RenderViewHost to send upwards to |
| 518 // its delegate. | 510 // its delegate. |
| 519 | 511 |
| 520 // Called when a mousewheel event was not processed by the renderer. | 512 // Called when a mousewheel event was not processed by the renderer. |
| 521 virtual void UnhandledWheelEvent(const blink::WebMouseWheelEvent& event) {} | 513 virtual void UnhandledWheelEvent(const blink::WebMouseWheelEvent& event) {} |
| 522 | 514 |
| 523 // Notification that the user has made some kind of input that could | |
| 524 // perform an action. The gestures that count are 1) any mouse down | |
| 525 // event and 2) enter or space key presses. | |
| 526 virtual void OnUserGesture() {} | |
| 527 | |
| 528 // Callbacks for notification when the renderer becomes unresponsive to user | |
| 529 // input events, and subsequently responsive again. | |
| 530 virtual void NotifyRendererUnresponsive() {} | |
| 531 virtual void NotifyRendererResponsive() {} | |
| 532 | |
| 533 // Callback for notification that we failed to receive any rendered graphics | 515 // Callback for notification that we failed to receive any rendered graphics |
| 534 // from a newly loaded page. Used for testing. | 516 // from a newly loaded page. Used for testing. |
| 535 virtual void NotifyNewContentRenderingTimeoutForTesting() {} | 517 virtual void NotifyNewContentRenderingTimeoutForTesting() {} |
| 536 | 518 |
| 537 // Called when auto-resize resulted in the renderer size changing. | |
| 538 virtual void OnRenderAutoResized(const gfx::Size& new_size) {} | |
| 539 | |
| 540 // --------------------------------------------------------------------------- | 519 // --------------------------------------------------------------------------- |
| 541 | 520 |
| 542 // RenderViewHost overrides this method to impose further restrictions on when | 521 void RequestToLockMouse(bool user_gesture, bool last_unlocked_by_target); |
| 543 // to allow mouse lock. | |
| 544 // Once the request is approved or rejected, GotResponseToLockMouseRequest() | |
| 545 // will be called. | |
| 546 virtual void RequestToLockMouse(bool user_gesture, | |
| 547 bool last_unlocked_by_target); | |
| 548 | 522 |
| 549 bool IsMouseLocked() const; | 523 bool IsMouseLocked() const; |
| 550 | 524 |
| 551 // RenderViewHost overrides this method to report whether tab-initiated | 525 // RenderViewHost overrides this method to report whether tab-initiated |
| 552 // fullscreen was granted. | 526 // fullscreen was granted. |
| 553 virtual bool IsFullscreenGranted() const; | 527 virtual bool IsFullscreenGranted() const; |
| 554 | 528 |
| 555 virtual blink::WebDisplayMode GetDisplayMode() const; | 529 virtual blink::WebDisplayMode GetDisplayMode() const; |
| 556 | 530 |
| 557 // The View associated with the RenderViewHost. The lifetime of this object | 531 // The View associated with the RenderViewHost. The lifetime of this object |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 base::TimeDelta new_content_rendering_delay_; | 828 base::TimeDelta new_content_rendering_delay_; |
| 855 | 829 |
| 856 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 830 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 857 | 831 |
| 858 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 832 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 859 }; | 833 }; |
| 860 | 834 |
| 861 } // namespace content | 835 } // namespace content |
| 862 | 836 |
| 863 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 837 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |