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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Add test for JS cursor movement Created 3 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/render_widget_host_view_guest.h" 5 #include "content/browser/frame_host/render_widget_host_view_guest.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 guest_->GetScreenCoordinates(character_bounds[i].origin()), 413 guest_->GetScreenCoordinates(character_bounds[i].origin()),
414 character_bounds[i].size())); 414 character_bounds[i].size()));
415 } 415 }
416 // Forward the information to embedding RWHV. 416 // Forward the information to embedding RWHV.
417 rwhv->ImeCompositionRangeChanged(range, guest_character_bounds); 417 rwhv->ImeCompositionRangeChanged(range, guest_character_bounds);
418 } 418 }
419 #endif 419 #endif
420 420
421 void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text, 421 void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text,
422 size_t offset, 422 size_t offset,
423 const gfx::Range& range) { 423 const gfx::Range& range,
424 bool user_initiated) {
424 RenderWidgetHostViewBase* view = should_forward_text_selection_ 425 RenderWidgetHostViewBase* view = should_forward_text_selection_
425 ? GetOwnerRenderWidgetHostView() 426 ? GetOwnerRenderWidgetHostView()
426 : platform_view_.get(); 427 : platform_view_.get();
427 if (view) 428 if (view)
428 view->SelectionChanged(text, offset, range); 429 view->SelectionChanged(text, offset, range, user_initiated);
429 } 430 }
430 431
431 void RenderWidgetHostViewGuest::SelectionBoundsChanged( 432 void RenderWidgetHostViewGuest::SelectionBoundsChanged(
432 const ViewHostMsg_SelectionBounds_Params& params) { 433 const ViewHostMsg_SelectionBounds_Params& params) {
433 if (!guest_) 434 if (!guest_)
434 return; 435 return;
435 436
436 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); 437 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView();
437 if (!rwhv) 438 if (!rwhv)
438 return; 439 return;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 host_->ForwardGestureEvent(gesture_event); 692 host_->ForwardGestureEvent(gesture_event);
692 return; 693 return;
693 } 694 }
694 } 695 }
695 696
696 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { 697 bool RenderWidgetHostViewGuest::HasEmbedderChanged() {
697 return guest_ && guest_->has_attached_since_surface_set(); 698 return guest_ && guest_->has_attached_since_surface_set();
698 } 699 }
699 700
700 } // namespace content 701 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698