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_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <IOSurface/IOSurface.h> | 9 #include <IOSurface/IOSurface.h> |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 | 480 |
481 // Returns the TextSelection information for the active widget. If | 481 // Returns the TextSelection information for the active widget. If |
482 // |is_guest_view_hack_| is true, then it will return the TextSelection | 482 // |is_guest_view_hack_| is true, then it will return the TextSelection |
483 // information for this RenderWidgetHostViewMac (which is serving as a | 483 // information for this RenderWidgetHostViewMac (which is serving as a |
484 // platform view for a guest). | 484 // platform view for a guest). |
485 const TextInputManager::TextSelection* GetTextSelection(); | 485 const TextInputManager::TextSelection* GetTextSelection(); |
486 | 486 |
487 // Get the focused view that should be used for retrieving the text selection. | 487 // Get the focused view that should be used for retrieving the text selection. |
488 RenderWidgetHostViewBase* GetFocusedViewForTextSelection(); | 488 RenderWidgetHostViewBase* GetFocusedViewForTextSelection(); |
489 | 489 |
| 490 void ScheduleMouseWheelEndDispatching(blink::WebMouseWheelEvent wheel_event, |
| 491 bool should_route_event); |
| 492 void DispatchPendingWheelEndEvent(); |
| 493 void IgnorePendingWheelEndEvent(); |
| 494 bool HasPendingWheelEndEvent(); |
| 495 |
490 // Returns the RenderWidgetHostDelegate corresponding to the currently focused | 496 // Returns the RenderWidgetHostDelegate corresponding to the currently focused |
491 // RenderWidgetHost. It is different from |render_widget_host_->delegate()| | 497 // RenderWidgetHost. It is different from |render_widget_host_->delegate()| |
492 // when there are focused inner WebContentses on the page. Also, this method | 498 // when there are focused inner WebContentses on the page. Also, this method |
493 // can return nullptr; for instance when |render_widget_host_| becomes nullptr | 499 // can return nullptr; for instance when |render_widget_host_| becomes nullptr |
494 // in the destruction path of the WebContentsImpl. | 500 // in the destruction path of the WebContentsImpl. |
495 RenderWidgetHostDelegate* GetFocusedRenderWidgetHostDelegate(); | 501 RenderWidgetHostDelegate* GetFocusedRenderWidgetHostDelegate(); |
496 | 502 |
497 private: | 503 private: |
498 friend class RenderWidgetHostViewMacTest; | 504 friend class RenderWidgetHostViewMacTest; |
499 | 505 |
500 // Returns whether this render view is a popup (autocomplete window). | 506 // Returns whether this render view is a popup (autocomplete window). |
501 bool IsPopup() const; | 507 bool IsPopup() const; |
502 | 508 |
503 // Shuts down the render_widget_host_. This is a separate function so we can | 509 // Shuts down the render_widget_host_. This is a separate function so we can |
504 // invoke it from the message loop. | 510 // invoke it from the message loop. |
505 void ShutdownHost(); | 511 void ShutdownHost(); |
506 | 512 |
507 // IPC message handlers. | 513 // IPC message handlers. |
508 void OnGetRenderedTextCompleted(const std::string& text); | 514 void OnGetRenderedTextCompleted(const std::string& text); |
509 | 515 |
510 // Send updated vsync parameters to the top level display. | 516 // Send updated vsync parameters to the top level display. |
511 void UpdateDisplayVSyncParameters(); | 517 void UpdateDisplayVSyncParameters(); |
512 | 518 |
513 // Dispatches a TTS session. | 519 // Dispatches a TTS session. |
514 void SpeakText(const std::string& text); | 520 void SpeakText(const std::string& text); |
515 | 521 |
516 // Adds/Removes frame observer based on state. | 522 // Adds/Removes frame observer based on state. |
517 void UpdateNeedsBeginFramesInternal(); | 523 void UpdateNeedsBeginFramesInternal(); |
518 | 524 |
| 525 void SendSyntheticWheelEventWithPhaseEnded( |
| 526 blink::WebMouseWheelEvent wheel_event, |
| 527 bool should_route_event); |
| 528 |
519 // The associated view. This is weak and is inserted into the view hierarchy | 529 // The associated view. This is weak and is inserted into the view hierarchy |
520 // to own this RenderWidgetHostViewMac object. Set to nil at the start of the | 530 // to own this RenderWidgetHostViewMac object. Set to nil at the start of the |
521 // destructor. | 531 // destructor. |
522 RenderWidgetHostViewCocoa* cocoa_view_; | 532 RenderWidgetHostViewCocoa* cocoa_view_; |
523 | 533 |
524 // Indicates if the page is loading. | 534 // Indicates if the page is loading. |
525 bool is_loading_; | 535 bool is_loading_; |
526 | 536 |
527 // Whether it's allowed to pause waiting for a new frame. | 537 // Whether it's allowed to pause waiting for a new frame. |
528 bool allow_pause_for_resize_or_repaint_; | 538 bool allow_pause_for_resize_or_repaint_; |
(...skipping 29 matching lines...) Expand all Loading... |
558 bool needs_begin_frames_; | 568 bool needs_begin_frames_; |
559 | 569 |
560 // Whether a request to flush input has been issued. | 570 // Whether a request to flush input has been issued. |
561 bool needs_flush_input_; | 571 bool needs_flush_input_; |
562 | 572 |
563 // The background color of the web content. This color will be drawn when the | 573 // The background color of the web content. This color will be drawn when the |
564 // web content is not able to draw in time. | 574 // web content is not able to draw in time. |
565 SkColor background_color_ = SK_ColorTRANSPARENT; | 575 SkColor background_color_ = SK_ColorTRANSPARENT; |
566 SkColor last_frame_root_background_color_ = SK_ColorTRANSPARENT; | 576 SkColor last_frame_root_background_color_ = SK_ColorTRANSPARENT; |
567 | 577 |
| 578 base::OneShotTimer mouse_wheel_end_dispatch_timer_; |
| 579 |
568 // Factory used to safely scope delayed calls to ShutdownHost(). | 580 // Factory used to safely scope delayed calls to ShutdownHost(). |
569 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; | 581 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; |
570 | 582 |
571 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 583 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
572 }; | 584 }; |
573 | 585 |
574 } // namespace content | 586 } // namespace content |
575 | 587 |
576 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 588 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |