OLD | NEW |
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/autocomplete/autocomplete_controller.h" | 5 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 // Whether this autocomplete match type supports custom descriptions. | 146 // Whether this autocomplete match type supports custom descriptions. |
147 bool AutocompleteMatchHasCustomDescription(const AutocompleteMatch& match) { | 147 bool AutocompleteMatchHasCustomDescription(const AutocompleteMatch& match) { |
148 return match.type == AutocompleteMatchType::SEARCH_SUGGEST_ENTITY || | 148 return match.type == AutocompleteMatchType::SEARCH_SUGGEST_ENTITY || |
149 match.type == AutocompleteMatchType::SEARCH_SUGGEST_PROFILE; | 149 match.type == AutocompleteMatchType::SEARCH_SUGGEST_PROFILE; |
150 } | 150 } |
151 | 151 |
152 } // namespace | 152 } // namespace |
153 | 153 |
154 const int AutocompleteController::kNoItemSelected = -1; | |
155 | |
156 AutocompleteController::AutocompleteController( | 154 AutocompleteController::AutocompleteController( |
157 Profile* profile, | 155 Profile* profile, |
158 AutocompleteControllerDelegate* delegate, | 156 AutocompleteControllerDelegate* delegate, |
159 int provider_types) | 157 int provider_types) |
160 : delegate_(delegate), | 158 : delegate_(delegate), |
161 history_url_provider_(NULL), | 159 history_url_provider_(NULL), |
162 keyword_provider_(NULL), | 160 keyword_provider_(NULL), |
163 search_provider_(NULL), | 161 search_provider_(NULL), |
164 zero_suggest_provider_(NULL), | 162 zero_suggest_provider_(NULL), |
165 stop_timer_duration_(OmniboxFieldTrial::StopTimerFieldTrialDuration()), | 163 stop_timer_duration_(OmniboxFieldTrial::StopTimerFieldTrialDuration()), |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 this, &AutocompleteController::ExpireCopiedEntries); | 645 this, &AutocompleteController::ExpireCopiedEntries); |
648 } | 646 } |
649 | 647 |
650 void AutocompleteController::StartStopTimer() { | 648 void AutocompleteController::StartStopTimer() { |
651 stop_timer_.Start(FROM_HERE, | 649 stop_timer_.Start(FROM_HERE, |
652 stop_timer_duration_, | 650 stop_timer_duration_, |
653 base::Bind(&AutocompleteController::Stop, | 651 base::Bind(&AutocompleteController::Stop, |
654 base::Unretained(this), | 652 base::Unretained(this), |
655 false)); | 653 false)); |
656 } | 654 } |
OLD | NEW |