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

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

Issue 2425703003: Fix failing DCHECK in AutoCompleteInput() (Closed)
Patch Set: use pkasting's suggested code Created 4 years, 2 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 "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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 return delete_at_end_pressed_; 445 return delete_at_end_pressed_;
446 } 446 }
447 447
448 void OmniboxViewViews::UpdatePopup() { 448 void OmniboxViewViews::UpdatePopup() {
449 model()->SetInputInProgress(true); 449 model()->SetInputInProgress(true);
450 if (!model()->has_focus()) 450 if (!model()->has_focus())
451 return; 451 return;
452 452
453 // Prevent inline autocomplete when the caret isn't at the end of the text. 453 // Prevent inline autocomplete when the caret isn't at the end of the text.
454 const gfx::Range sel = GetSelectedRange(); 454 const gfx::Range sel = GetSelectedRange();
455 model()->StartAutocomplete(!sel.is_empty(), sel.GetMax() < text().length(), 455 model()->StartAutocomplete(!sel.is_empty(), sel.GetMax() < text().length());
456 false);
457 } 456 }
458 457
459 void OmniboxViewViews::ApplyCaretVisibility() { 458 void OmniboxViewViews::ApplyCaretVisibility() {
460 SetCursorEnabled(model()->is_caret_visible()); 459 SetCursorEnabled(model()->is_caret_visible());
461 } 460 }
462 461
463 void OmniboxViewViews::OnTemporaryTextMaybeChanged( 462 void OmniboxViewViews::OnTemporaryTextMaybeChanged(
464 const base::string16& display_text, 463 const base::string16& display_text,
465 bool save_original_selection, 464 bool save_original_selection,
466 bool notify_text_changed) { 465 bool notify_text_changed) {
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); 1074 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO);
1076 1075
1077 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); 1076 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR);
1078 1077
1079 // Minor note: We use IDC_ for command id here while the underlying textfield 1078 // Minor note: We use IDC_ for command id here while the underlying textfield
1080 // is using IDS_ for all its command ids. This is because views cannot depend 1079 // is using IDS_ for all its command ids. This is because views cannot depend
1081 // on IDC_ for now. 1080 // on IDC_ for now.
1082 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, 1081 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES,
1083 IDS_EDIT_SEARCH_ENGINES); 1082 IDS_EDIT_SEARCH_ENGINES);
1084 } 1083 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view_browsertest.cc ('k') | components/omnibox/browser/omnibox_edit_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698