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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view_browsertest.cc ('k') | 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 "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if (notify_text_changed) 428 if (notify_text_changed)
429 TextChanged(); 429 TextChanged();
430 } 430 }
431 431
432 void OmniboxViewViews::SetCaretPos(size_t caret_pos) { 432 void OmniboxViewViews::SetCaretPos(size_t caret_pos) {
433 SelectRange(gfx::Range(caret_pos, caret_pos)); 433 SelectRange(gfx::Range(caret_pos, caret_pos));
434 } 434 }
435 435
436 bool OmniboxViewViews::IsSelectAll() const { 436 bool OmniboxViewViews::IsSelectAll() const {
437 // TODO(oshima): IME support. 437 // TODO(oshima): IME support.
438 return text() == GetSelectedText(); 438 return !text().empty() && text() == GetSelectedText();
439 } 439 }
440 440
441 bool OmniboxViewViews::DeleteAtEndPressed() { 441 bool OmniboxViewViews::DeleteAtEndPressed() {
442 return delete_at_end_pressed_; 442 return delete_at_end_pressed_;
443 } 443 }
444 444
445 void OmniboxViewViews::UpdatePopup() { 445 void OmniboxViewViews::UpdatePopup() {
446 model()->SetInputInProgress(true); 446 model()->SetInputInProgress(true);
447 if (!model()->has_focus()) 447 if (!model()->has_focus())
448 return; 448 return;
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); 1081 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO);
1082 1082
1083 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); 1083 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR);
1084 1084
1085 // Minor note: We use IDC_ for command id here while the underlying textfield 1085 // Minor note: We use IDC_ for command id here while the underlying textfield
1086 // is using IDS_ for all its command ids. This is because views cannot depend 1086 // is using IDS_ for all its command ids. This is because views cannot depend
1087 // on IDC_ for now. 1087 // on IDC_ for now.
1088 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, 1088 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES,
1089 IDS_EDIT_SEARCH_ENGINES); 1089 IDS_EDIT_SEARCH_ENGINES);
1090 } 1090 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698