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

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: Checked content_view_core_ before using it. 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(!content_view_core_)
662 return;
663
664 if(range.is_empty()) {
jdduke (slow) 2014/07/31 14:53:57 There should always be a space between if and the
665 content_view_core_->OnSelectionChanged("");
666 return;
667 }
668
669 if (text.empty())
jdduke (slow) 2014/07/31 14:53:57 This should be DCHECK(!text.empty()), as the text
662 return; 670 return;
663 size_t pos = range.GetMin() - offset; 671 size_t pos = range.GetMin() - offset;
664 size_t n = range.length(); 672 size_t n = range.length();
665 673
666 DCHECK(pos + n <= text.length()) << "The text can not fully cover range."; 674 DCHECK(pos + n <= text.length()) << "The text can not fully cover range.";
667 if (pos >= text.length()) { 675 if (pos >= text.length()) {
668 NOTREACHED() << "The text can not cover range."; 676 NOTREACHED() << "The text can not cover range.";
669 return; 677 return;
670 } 678 }
671 679
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 results->orientationAngle = display.RotationAsDegree(); 1649 results->orientationAngle = display.RotationAsDegree();
1642 results->orientationType = 1650 results->orientationType =
1643 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1651 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1644 gfx::DeviceDisplayInfo info; 1652 gfx::DeviceDisplayInfo info;
1645 results->depth = info.GetBitsPerPixel(); 1653 results->depth = info.GetBitsPerPixel();
1646 results->depthPerComponent = info.GetBitsPerComponent(); 1654 results->depthPerComponent = info.GetBitsPerComponent();
1647 results->isMonochrome = (results->depthPerComponent == 0); 1655 results->isMonochrome = (results->depthPerComponent == 0);
1648 } 1656 }
1649 1657
1650 } // namespace content 1658 } // 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