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

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

Issue 425693003: Single character is coming in search box after searching empty selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 void RenderWidgetHostViewAndroid::SetTooltipText( 651 void RenderWidgetHostViewAndroid::SetTooltipText(
652 const base::string16& tooltip_text) { 652 const base::string16& tooltip_text) {
653 // Tooltips don't makes sense on Android. 653 // Tooltips don't makes sense on Android.
654 } 654 }
655 655
656 void RenderWidgetHostViewAndroid::SelectionChanged(const base::string16& text, 656 void RenderWidgetHostViewAndroid::SelectionChanged(const base::string16& text,
657 size_t offset, 657 size_t offset,
658 const gfx::Range& range) { 658 const gfx::Range& range) {
659 RenderWidgetHostViewBase::SelectionChanged(text, offset, range); 659 RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
660 660
661 if (text.empty() || range.is_empty() || !content_view_core_) 661 if(range.is_empty()) {
jdduke (slow) 2014/07/28 18:42:24 Will |range| always be empty if |text| is empty?
jdduke (slow) 2014/07/30 15:40:15 The |content_View_core_| null check needs to go be
Cyan 2014/07/31 05:34:16 Acknowledged.
662 content_view_core_->OnSelectionChanged("");
663 return;
664 }
665 if (text.empty() || !content_view_core_)
662 return; 666 return;
663 size_t pos = range.GetMin() - offset; 667 size_t pos = range.GetMin() - offset;
664 size_t n = range.length(); 668 size_t n = range.length();
665 669
666 DCHECK(pos + n <= text.length()) << "The text can not fully cover range."; 670 DCHECK(pos + n <= text.length()) << "The text can not fully cover range.";
667 if (pos >= text.length()) { 671 if (pos >= text.length()) {
668 NOTREACHED() << "The text can not cover range."; 672 NOTREACHED() << "The text can not cover range.";
669 return; 673 return;
670 } 674 }
671 675
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 results->orientationAngle = display.RotationAsDegree(); 1645 results->orientationAngle = display.RotationAsDegree();
1642 results->orientationType = 1646 results->orientationType =
1643 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1647 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1644 gfx::DeviceDisplayInfo info; 1648 gfx::DeviceDisplayInfo info;
1645 results->depth = info.GetBitsPerPixel(); 1649 results->depth = info.GetBitsPerPixel();
1646 results->depthPerComponent = info.GetBitsPerComponent(); 1650 results->depthPerComponent = info.GetBitsPerComponent();
1647 results->isMonochrome = (results->depthPerComponent == 0); 1651 results->isMonochrome = (results->depthPerComponent == 0);
1648 } 1652 }
1649 1653
1650 } // namespace content 1654 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698