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

Side by Side Diff: chrome/browser/autocomplete/autocomplete.cc

Issue 3152029: Ctrl-based actions should take precedence over ctrl-enter (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Cleaning things up Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/autocomplete/autocomplete.h" 5 #include "chrome/browser/autocomplete/autocomplete.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 // is harmless. 896 // is harmless.
897 } 897 }
898 898
899 void AutocompleteController::CommitIfQueryHasNeverBeenCommitted() { 899 void AutocompleteController::CommitIfQueryHasNeverBeenCommitted() {
900 if (!have_committed_during_this_query_) 900 if (!have_committed_during_this_query_)
901 CommitResult(true); 901 CommitResult(true);
902 } 902 }
903 903
904 void AutocompleteController::OnProviderUpdate(bool updated_matches) { 904 void AutocompleteController::OnProviderUpdate(bool updated_matches) {
905 CheckIfDone(); 905 CheckIfDone();
906 if (updated_matches || done_) { 906 if (updated_matches || done_)
907 UpdateLatestResult(false); 907 UpdateLatestResult(false);
908 return;
909 }
910 } 908 }
911 909
912 void AutocompleteController::UpdateLatestResult(bool is_synchronous_pass) { 910 void AutocompleteController::UpdateLatestResult(bool is_synchronous_pass) {
913 // Add all providers' matches. 911 // Add all providers' matches.
914 latest_result_.Reset(); 912 latest_result_.Reset();
915 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); 913 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end();
916 ++i) 914 ++i)
917 latest_result_.AppendMatches((*i)->matches()); 915 latest_result_.AppendMatches((*i)->matches());
918 updated_latest_result_ = true; 916 updated_latest_result_ = true;
919 917
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 void AutocompleteController::CheckIfDone() { 1085 void AutocompleteController::CheckIfDone() {
1088 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); 1086 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end();
1089 ++i) { 1087 ++i) {
1090 if (!(*i)->done()) { 1088 if (!(*i)->done()) {
1091 done_ = false; 1089 done_ = false;
1092 return; 1090 return;
1093 } 1091 }
1094 } 1092 }
1095 done_ = true; 1093 done_ = true;
1096 } 1094 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit.h » ('j') | chrome/browser/autocomplete/autocomplete_edit.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698