Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.h

Issue 1948343002: [reland] Browser Side Text Input State Tracking for OOPIF (Aura Only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 aura::Window* window() { return window_; } 343 aura::Window* window() { return window_; }
343 344
344 DelegatedFrameHost* GetDelegatedFrameHost() const { 345 DelegatedFrameHost* GetDelegatedFrameHost() const {
345 return delegated_frame_host_.get(); 346 return delegated_frame_host_.get();
346 } 347 }
347 348
348 const ui::MotionEventAura& pointer_state() const { return pointer_state_; } 349 const ui::MotionEventAura& pointer_state() const { return pointer_state_; }
349 350
350 private: 351 private:
351 friend class RenderWidgetHostViewAuraCopyRequestTest; 352 friend class RenderWidgetHostViewAuraCopyRequestTest;
353 friend class TestInputMethodObserver;
352 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 354 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
353 PopupRetainsCaptureAfterMouseRelease); 355 PopupRetainsCaptureAfterMouseRelease);
354 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); 356 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText);
355 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); 357 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState);
356 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 358 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
357 TouchEventPositionsArentRounded); 359 TouchEventPositionsArentRounded);
358 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); 360 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync);
359 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, Resize); 361 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, Resize);
360 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); 362 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow);
361 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, RecreateLayers); 363 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, RecreateLayers);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 const cc::CompositorFrameAck& ack) override; 460 const cc::CompositorFrameAck& ack) override;
459 void DelegatedFrameHostSendReclaimCompositorResources( 461 void DelegatedFrameHostSendReclaimCompositorResources(
460 int output_surface_id, 462 int output_surface_id,
461 const cc::CompositorFrameAck& ack) override; 463 const cc::CompositorFrameAck& ack) override;
462 void DelegatedFrameHostOnLostCompositorResources() override; 464 void DelegatedFrameHostOnLostCompositorResources() override;
463 void DelegatedFrameHostUpdateVSyncParameters( 465 void DelegatedFrameHostUpdateVSyncParameters(
464 const base::TimeTicks& timebase, 466 const base::TimeTicks& timebase,
465 const base::TimeDelta& interval) override; 467 const base::TimeDelta& interval) override;
466 void SetBeginFrameSource(cc::BeginFrameSource* source) override; 468 void SetBeginFrameSource(cc::BeginFrameSource* source) override;
467 469
470 // TextInputManager::Observer implementation.
471 void OnUpdateTextInputStateCalled(TextInputManager* text_input_manager,
472 RenderWidgetHostViewBase* updated_view,
473 bool did_update_state) override;
474
468 // cc::BeginFrameObserver implementation. 475 // cc::BeginFrameObserver implementation.
469 void OnBeginFrame(const cc::BeginFrameArgs& args) override; 476 void OnBeginFrame(const cc::BeginFrameArgs& args) override;
470 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; 477 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override;
471 void OnBeginFrameSourcePausedChanged(bool paused) override; 478 void OnBeginFrameSourcePausedChanged(bool paused) override;
472 479
473 // Detaches |this| from the input method object. 480 // Detaches |this| from the input method object.
474 void DetachFromInputMethod(); 481 void DetachFromInputMethod();
475 482
476 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method 483 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method
477 // calls our keybindings handler against the event and send matched 484 // calls our keybindings handler against the event and send matched
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 // True when content is being loaded. Used to show an hourglass cursor. 574 // True when content is being loaded. Used to show an hourglass cursor.
568 bool is_loading_; 575 bool is_loading_;
569 576
570 // The cursor for the page. This is passed up from the renderer. 577 // The cursor for the page. This is passed up from the renderer.
571 WebCursor current_cursor_; 578 WebCursor current_cursor_;
572 579
573 // Stores the current state of the active pointers targeting this 580 // Stores the current state of the active pointers targeting this
574 // object. 581 // object.
575 ui::MotionEventAura pointer_state_; 582 ui::MotionEventAura pointer_state_;
576 583
577 // The current text input type.
578 ui::TextInputType text_input_type_;
579 // The current text input mode corresponding to HTML5 inputmode attribute.
580 ui::TextInputMode text_input_mode_;
581 // The current text input flags.
582 int text_input_flags_;
583 bool can_compose_inline_;
584
585 // Bounds for the selection. 584 // Bounds for the selection.
586 ui::SelectionBound selection_anchor_; 585 ui::SelectionBound selection_anchor_;
587 ui::SelectionBound selection_focus_; 586 ui::SelectionBound selection_focus_;
588 587
589 // The current composition character bounds. 588 // The current composition character bounds.
590 std::vector<gfx::Rect> composition_character_bounds_; 589 std::vector<gfx::Rect> composition_character_bounds_;
591 590
592 // Indicates if there is onging composition text. 591 // Indicates if there is onging composition text.
593 bool has_composition_text_; 592 bool has_composition_text_;
594 593
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 bool disable_input_event_router_for_testing_; 690 bool disable_input_event_router_for_testing_;
692 691
693 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; 692 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
694 693
695 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 694 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
696 }; 695 };
697 696
698 } // namespace content 697 } // namespace content
699 698
700 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 699 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698