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

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

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Suppress superfluous non-user initiated text selection events 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 (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_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 Send(new ViewMsg_ForceRedraw(GetRoutingID(), latency_info)); 1522 Send(new ViewMsg_ForceRedraw(GetRoutingID(), latency_info));
1523 } 1523 }
1524 1524
1525 const NativeWebKeyboardEvent* 1525 const NativeWebKeyboardEvent*
1526 RenderWidgetHostImpl::GetLastKeyboardEvent() const { 1526 RenderWidgetHostImpl::GetLastKeyboardEvent() const {
1527 return input_router_->GetLastKeyboardEvent(); 1527 return input_router_->GetLastKeyboardEvent();
1528 } 1528 }
1529 1529
1530 void RenderWidgetHostImpl::SelectionChanged(const base::string16& text, 1530 void RenderWidgetHostImpl::SelectionChanged(const base::string16& text,
1531 uint32_t offset, 1531 uint32_t offset,
1532 const gfx::Range& range) { 1532 const gfx::Range& range,
1533 if (view_) 1533 bool user_initiated) {
1534 view_->SelectionChanged(text, static_cast<size_t>(offset), range); 1534 if (view_) {
1535 view_->SelectionChanged(text, static_cast<size_t>(offset), range,
1536 user_initiated);
1537 }
1535 } 1538 }
1536 1539
1537 void RenderWidgetHostImpl::OnSelectionBoundsChanged( 1540 void RenderWidgetHostImpl::OnSelectionBoundsChanged(
1538 const ViewHostMsg_SelectionBounds_Params& params) { 1541 const ViewHostMsg_SelectionBounds_Params& params) {
1539 if (view_) 1542 if (view_)
1540 view_->SelectionBoundsChanged(params); 1543 view_->SelectionBoundsChanged(params);
1541 } 1544 }
1542 1545
1543 void RenderWidgetHostImpl::OnSetNeedsBeginFrames(bool needs_begin_frames) { 1546 void RenderWidgetHostImpl::OnSetNeedsBeginFrames(bool needs_begin_frames) {
1544 if (needs_begin_frames_ == needs_begin_frames) 1547 if (needs_begin_frames_ == needs_begin_frames)
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 device::mojom::WakeLockType::PreventDisplaySleep, 2698 device::mojom::WakeLockType::PreventDisplaySleep,
2696 device::mojom::WakeLockReason::ReasonOther, "GetSnapshot", 2699 device::mojom::WakeLockReason::ReasonOther, "GetSnapshot",
2697 std::move(request)); 2700 std::move(request));
2698 } 2701 }
2699 } 2702 }
2700 return wake_lock_.get(); 2703 return wake_lock_.get();
2701 } 2704 }
2702 #endif 2705 #endif
2703 2706
2704 } // namespace content 2707 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698