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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_base.cc

Issue 1652483002: Browser Side Text Input State Tracking for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Comments and Fixing Compile Errors Created 4 years, 10 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 #include "content/browser/renderer_host/render_widget_host_view_base.h" 5 #include "content/browser/renderer_host/render_widget_host_view_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/accessibility/browser_accessibility_manager.h" 9 #include "content/browser/accessibility/browser_accessibility_manager.h"
10 #include "content/browser/gpu/gpu_data_manager_impl.h" 10 #include "content/browser/gpu/gpu_data_manager_impl.h"
11 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" 11 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
12 #include "content/browser/renderer_host/render_process_host_impl.h" 12 #include "content/browser/renderer_host/render_process_host_impl.h"
13 #include "content/browser/renderer_host/render_view_host_delegate.h"
14 #include "content/browser/renderer_host/render_view_host_impl.h"
15 #include "content/browser/renderer_host/render_widget_host_delegate.h"
13 #include "content/browser/renderer_host/render_widget_host_impl.h" 16 #include "content/browser/renderer_host/render_widget_host_impl.h"
14 #include "content/common/content_switches_internal.h" 17 #include "content/common/content_switches_internal.h"
18 #include "content/common/input_messages.h"
19 #include "content/common/site_isolation_policy.h"
20 #include "content/common/view_messages.h"
15 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" 21 #include "content/public/browser/render_widget_host_view_frame_subscriber.h"
22 #include "content/public/common/browser_plugin_guest_mode.h"
16 #include "ui/gfx/display.h" 23 #include "ui/gfx/display.h"
17 #include "ui/gfx/geometry/point_conversions.h" 24 #include "ui/gfx/geometry/point_conversions.h"
18 #include "ui/gfx/geometry/size_conversions.h" 25 #include "ui/gfx/geometry/size_conversions.h"
19 #include "ui/gfx/geometry/size_f.h" 26 #include "ui/gfx/geometry/size_f.h"
20 #include "ui/gfx/screen.h" 27 #include "ui/gfx/screen.h"
21 28
22 #if defined(OS_WIN) 29 #if defined(OS_WIN)
23 #include "base/command_line.h" 30 #include "base/command_line.h"
24 #include "base/message_loop/message_loop.h" 31 #include "base/message_loop/message_loop.h"
25 #include "base/win/wrapped_window_proc.h" 32 #include "base/win/wrapped_window_proc.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 : popup_type_(blink::WebPopupTypeNone), 377 : popup_type_(blink::WebPopupTypeNone),
371 background_color_(SK_ColorWHITE), 378 background_color_(SK_ColorWHITE),
372 mouse_locked_(false), 379 mouse_locked_(false),
373 showing_context_menu_(false), 380 showing_context_menu_(false),
374 selection_text_offset_(0), 381 selection_text_offset_(0),
375 selection_range_(gfx::Range::InvalidRange()), 382 selection_range_(gfx::Range::InvalidRange()),
376 current_device_scale_factor_(0), 383 current_device_scale_factor_(0),
377 current_display_rotation_(gfx::Display::ROTATE_0), 384 current_display_rotation_(gfx::Display::ROTATE_0),
378 pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), 385 pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
379 renderer_frame_number_(0), 386 renderer_frame_number_(0),
387 text_input_state_(new TextInputState),
388 cached_text_input_state_(text_input_state_.get()),
380 weak_factory_(this) { 389 weak_factory_(this) {
390 text_input_state_->can_compose_inline = true;
381 } 391 }
382 392
383 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { 393 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() {
384 DCHECK(!mouse_locked_); 394 DCHECK(!mouse_locked_);
385 } 395 }
386 396
387 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){ 397 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){
388 return false; 398 return false;
389 } 399 }
390 400
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 gfx::ToRoundedPoint(point))); 704 gfx::ToRoundedPoint(point)));
695 } 705 }
696 706
697 void RenderWidgetHostViewBase::TransformPointToLocalCoordSpace( 707 void RenderWidgetHostViewBase::TransformPointToLocalCoordSpace(
698 const gfx::Point& point, 708 const gfx::Point& point,
699 cc::SurfaceId original_surface, 709 cc::SurfaceId original_surface,
700 gfx::Point* transformed_point) { 710 gfx::Point* transformed_point) {
701 *transformed_point = point; 711 *transformed_point = point;
702 } 712 }
703 713
714 void RenderWidgetHostViewBase::TextInputStateChanged(
715 const ViewHostMsg_TextInputState_Params& params) {
716 #if defined(OS_ANDROID)
717 if (params.is_non_ime_change) {
718 // Sends an acknowledgement to the renderer of a processed IME event.
719 GetRenderWidgetHost()->Send(
720 new InputMsg_ImeEventAck(GetRenderWidgetHost()->GetRoutingID()));
721 }
722 #endif
723 *text_input_state_ = params;
724 UpdateTextInputState();
725 }
726
727 const TextInputState* RenderWidgetHostViewBase::FindCurrentTextInputState() {
728 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
729 return text_input_state_.get();
730
731 const TextInputState* state = text_input_state_.get();
732 RenderWidgetHostViewBase* focused_view =
733 RenderWidgetHostImpl::From(GetRenderWidgetHost())
734 ->delegate()
735 ->GetFocusedView();
736 if (focused_view && focused_view != this)
737 state = focused_view->FindCurrentTextInputState();
738 return state;
739 }
740
741 void RenderWidgetHostViewBase::UpdateTextInputState() {
742 cached_text_input_state_ = FindCurrentTextInputState();
743 }
744
704 } // namespace content 745 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698