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_AURA_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <memory> | 12 #include <memory> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/memory/linked_ptr.h" | 20 #include "base/memory/linked_ptr.h" |
21 #include "base/memory/ref_counted.h" | 21 #include "base/memory/ref_counted.h" |
22 #include "base/memory/weak_ptr.h" | 22 #include "base/memory/weak_ptr.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "cc/scheduler/begin_frame_source.h" | 24 #include "cc/scheduler/begin_frame_source.h" |
25 #include "content/browser/accessibility/browser_accessibility_manager.h" | 25 #include "content/browser/accessibility/browser_accessibility_manager.h" |
26 #include "content/browser/compositor/image_transport_factory.h" | 26 #include "content/browser/compositor/image_transport_factory.h" |
27 #include "content/browser/compositor/owned_mailbox.h" | 27 #include "content/browser/compositor/owned_mailbox.h" |
28 #include "content/browser/renderer_host/delegated_frame_host.h" | 28 #include "content/browser/renderer_host/delegated_frame_host.h" |
29 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 29 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 30 #include "content/browser/renderer_host/text_input_manager.h" |
30 #include "content/common/content_export.h" | 31 #include "content/common/content_export.h" |
31 #include "content/common/cursors/webcursor.h" | 32 #include "content/common/cursors/webcursor.h" |
32 #include "content/public/common/context_menu_params.h" | 33 #include "content/public/common/context_menu_params.h" |
33 #include "third_party/skia/include/core/SkRegion.h" | 34 #include "third_party/skia/include/core/SkRegion.h" |
34 #include "ui/aura/client/cursor_client_observer.h" | 35 #include "ui/aura/client/cursor_client_observer.h" |
35 #include "ui/aura/client/focus_change_observer.h" | 36 #include "ui/aura/client/focus_change_observer.h" |
36 #include "ui/aura/window_delegate.h" | 37 #include "ui/aura/window_delegate.h" |
37 #include "ui/aura/window_tracker.h" | 38 #include "ui/aura/window_tracker.h" |
38 #include "ui/aura/window_tree_host_observer.h" | 39 #include "ui/aura/window_tree_host_observer.h" |
39 #include "ui/base/ime/text_input_client.h" | 40 #include "ui/base/ime/text_input_client.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 class RenderViewHostDelegateView; | 89 class RenderViewHostDelegateView; |
89 class RenderWidgetHostImpl; | 90 class RenderWidgetHostImpl; |
90 class RenderWidgetHostView; | 91 class RenderWidgetHostView; |
91 class TouchSelectionControllerClientAura; | 92 class TouchSelectionControllerClientAura; |
92 struct TextInputState; | 93 struct TextInputState; |
93 | 94 |
94 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 95 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
95 class CONTENT_EXPORT RenderWidgetHostViewAura | 96 class CONTENT_EXPORT RenderWidgetHostViewAura |
96 : public RenderWidgetHostViewBase, | 97 : public RenderWidgetHostViewBase, |
97 public DelegatedFrameHostClient, | 98 public DelegatedFrameHostClient, |
| 99 public TextInputManager::Observer, |
98 public ui::TextInputClient, | 100 public ui::TextInputClient, |
99 public display::DisplayObserver, | 101 public display::DisplayObserver, |
100 public aura::WindowTreeHostObserver, | 102 public aura::WindowTreeHostObserver, |
101 public aura::WindowDelegate, | 103 public aura::WindowDelegate, |
102 public aura::client::ActivationDelegate, | 104 public aura::client::ActivationDelegate, |
103 public aura::client::FocusChangeObserver, | 105 public aura::client::FocusChangeObserver, |
104 public aura::client::CursorClientObserver, | 106 public aura::client::CursorClientObserver, |
105 public cc::BeginFrameObserver { | 107 public cc::BeginFrameObserver { |
106 public: | 108 public: |
107 // When |is_guest_view_hack| is true, this view isn't really the view for | 109 // When |is_guest_view_hack| is true, this view isn't really the view for |
(...skipping 25 matching lines...) Expand all Loading... |
133 void FocusedNodeTouched(const gfx::Point& location_dips_screen, | 135 void FocusedNodeTouched(const gfx::Point& location_dips_screen, |
134 bool editable) override; | 136 bool editable) override; |
135 | 137 |
136 // Overridden from RenderWidgetHostViewBase: | 138 // Overridden from RenderWidgetHostViewBase: |
137 void InitAsPopup(RenderWidgetHostView* parent_host_view, | 139 void InitAsPopup(RenderWidgetHostView* parent_host_view, |
138 const gfx::Rect& pos) override; | 140 const gfx::Rect& pos) override; |
139 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; | 141 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; |
140 void Focus() override; | 142 void Focus() override; |
141 void UpdateCursor(const WebCursor& cursor) override; | 143 void UpdateCursor(const WebCursor& cursor) override; |
142 void SetIsLoading(bool is_loading) override; | 144 void SetIsLoading(bool is_loading) override; |
143 void TextInputStateChanged(const TextInputState& params) override; | |
144 void ImeCancelComposition() override; | 145 void ImeCancelComposition() override; |
145 void ImeCompositionRangeChanged( | 146 void ImeCompositionRangeChanged( |
146 const gfx::Range& range, | 147 const gfx::Range& range, |
147 const std::vector<gfx::Rect>& character_bounds) override; | 148 const std::vector<gfx::Rect>& character_bounds) override; |
148 void RenderProcessGone(base::TerminationStatus status, | 149 void RenderProcessGone(base::TerminationStatus status, |
149 int error_code) override; | 150 int error_code) override; |
150 void Destroy() override; | 151 void Destroy() override; |
151 void SetTooltipText(const base::string16& tooltip_text) override; | 152 void SetTooltipText(const base::string16& tooltip_text) override; |
152 void SelectionChanged(const base::string16& text, | 153 void SelectionChanged(const base::string16& text, |
153 size_t offset, | 154 size_t offset, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 aura::Window* window() { return window_; } | 345 aura::Window* window() { return window_; } |
345 | 346 |
346 DelegatedFrameHost* GetDelegatedFrameHost() const { | 347 DelegatedFrameHost* GetDelegatedFrameHost() const { |
347 return delegated_frame_host_.get(); | 348 return delegated_frame_host_.get(); |
348 } | 349 } |
349 | 350 |
350 const ui::MotionEventAura& pointer_state() const { return pointer_state_; } | 351 const ui::MotionEventAura& pointer_state() const { return pointer_state_; } |
351 | 352 |
352 private: | 353 private: |
353 friend class RenderWidgetHostViewAuraCopyRequestTest; | 354 friend class RenderWidgetHostViewAuraCopyRequestTest; |
| 355 friend class TestInputMethodObserver; |
354 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 356 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
355 PopupRetainsCaptureAfterMouseRelease); | 357 PopupRetainsCaptureAfterMouseRelease); |
356 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); | 358 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); |
357 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); | 359 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); |
358 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 360 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
359 TouchEventPositionsArentRounded); | 361 TouchEventPositionsArentRounded); |
360 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); | 362 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); |
361 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, Resize); | 363 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, Resize); |
362 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); | 364 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); |
363 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, RecreateLayers); | 365 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, RecreateLayers); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 const cc::CompositorFrameAck& ack) override; | 462 const cc::CompositorFrameAck& ack) override; |
461 void DelegatedFrameHostSendReclaimCompositorResources( | 463 void DelegatedFrameHostSendReclaimCompositorResources( |
462 int output_surface_id, | 464 int output_surface_id, |
463 const cc::CompositorFrameAck& ack) override; | 465 const cc::CompositorFrameAck& ack) override; |
464 void DelegatedFrameHostOnLostCompositorResources() override; | 466 void DelegatedFrameHostOnLostCompositorResources() override; |
465 void DelegatedFrameHostUpdateVSyncParameters( | 467 void DelegatedFrameHostUpdateVSyncParameters( |
466 const base::TimeTicks& timebase, | 468 const base::TimeTicks& timebase, |
467 const base::TimeDelta& interval) override; | 469 const base::TimeDelta& interval) override; |
468 void SetBeginFrameSource(cc::BeginFrameSource* source) override; | 470 void SetBeginFrameSource(cc::BeginFrameSource* source) override; |
469 | 471 |
| 472 // TextInputManager::Observer implementation. |
| 473 void OnUpdateTextInputStateCalled(TextInputManager* text_input_manager, |
| 474 RenderWidgetHostViewBase* updated_view, |
| 475 bool did_update_state) override; |
| 476 |
470 // cc::BeginFrameObserver implementation. | 477 // cc::BeginFrameObserver implementation. |
471 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 478 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
472 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; | 479 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; |
473 void OnBeginFrameSourcePausedChanged(bool paused) override; | 480 void OnBeginFrameSourcePausedChanged(bool paused) override; |
474 | 481 |
475 // Detaches |this| from the input method object. | 482 // Detaches |this| from the input method object. |
476 void DetachFromInputMethod(); | 483 void DetachFromInputMethod(); |
477 | 484 |
478 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method | 485 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method |
479 // calls our keybindings handler against the event and send matched | 486 // calls our keybindings handler against the event and send matched |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 // True when content is being loaded. Used to show an hourglass cursor. | 576 // True when content is being loaded. Used to show an hourglass cursor. |
570 bool is_loading_; | 577 bool is_loading_; |
571 | 578 |
572 // The cursor for the page. This is passed up from the renderer. | 579 // The cursor for the page. This is passed up from the renderer. |
573 WebCursor current_cursor_; | 580 WebCursor current_cursor_; |
574 | 581 |
575 // Stores the current state of the active pointers targeting this | 582 // Stores the current state of the active pointers targeting this |
576 // object. | 583 // object. |
577 ui::MotionEventAura pointer_state_; | 584 ui::MotionEventAura pointer_state_; |
578 | 585 |
579 // The current text input type. | |
580 ui::TextInputType text_input_type_; | |
581 // The current text input mode corresponding to HTML5 inputmode attribute. | |
582 ui::TextInputMode text_input_mode_; | |
583 // The current text input flags. | |
584 int text_input_flags_; | |
585 bool can_compose_inline_; | |
586 | |
587 // Bounds for the selection. | 586 // Bounds for the selection. |
588 gfx::SelectionBound selection_anchor_; | 587 gfx::SelectionBound selection_anchor_; |
589 gfx::SelectionBound selection_focus_; | 588 gfx::SelectionBound selection_focus_; |
590 | 589 |
591 // The current composition character bounds. | 590 // The current composition character bounds. |
592 std::vector<gfx::Rect> composition_character_bounds_; | 591 std::vector<gfx::Rect> composition_character_bounds_; |
593 | 592 |
594 // Indicates if there is onging composition text. | 593 // Indicates if there is onging composition text. |
595 bool has_composition_text_; | 594 bool has_composition_text_; |
596 | 595 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 bool disable_input_event_router_for_testing_; | 692 bool disable_input_event_router_for_testing_; |
694 | 693 |
695 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 694 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
696 | 695 |
697 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 696 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
698 }; | 697 }; |
699 | 698 |
700 } // namespace content | 699 } // namespace content |
701 | 700 |
702 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 701 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |