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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 2942013002: [omnibox] Constrain 'IsSelectAll()' to be more accurate (Closed)
Patch Set: Missed a fix Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
index 4296eb52e181554e1e68b87695dd4bb19a7f0450..c38ea786368bed245c5adcd59050953b96db6fa2 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -369,6 +369,8 @@ bool OmniboxViewMac::IsSelectAll() const {
if (![field_ currentEditor])
return true;
const NSRange all_range = NSMakeRange(0, GetTextLength());
+ if (all_range.length == 0)
+ return false;
return NSEqualRanges(all_range, GetSelectedRange());
}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_browsertest.cc ('k') | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698