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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 } | 303 } |
304 } | 304 } |
305 | 305 |
306 void AutocompleteController::StartZeroSuggest( | 306 void AutocompleteController::StartZeroSuggest( |
307 const GURL& url, | 307 const GURL& url, |
308 AutocompleteInput::PageClassification page_classification, | 308 AutocompleteInput::PageClassification page_classification, |
309 const string16& permanent_text) { | 309 const string16& permanent_text) { |
310 if (zero_suggest_provider_ != NULL) { | 310 if (zero_suggest_provider_ != NULL) { |
311 DCHECK(!in_start_); // We should not be already running a query. | 311 DCHECK(!in_start_); // We should not be already running a query. |
312 in_zero_suggest_ = true; | 312 in_zero_suggest_ = true; |
313 zero_suggest_provider_->StartZeroSuggest( | 313 zero_suggest_provider_->StartZeroSuggest( |
Peter Kasting
2013/09/19 21:20:06
Doesn't this need to happen _after_ the current pa
H Fung
2013/09/21 01:13:25
OmniboxEditModel::OnSetFocus calls this function,
| |
314 url, page_classification, permanent_text); | 314 url, page_classification, permanent_text); |
315 } | 315 } |
316 if (search_provider_) | |
317 search_provider_->SetCurrentPageUrl(url); | |
Peter Kasting
2013/09/19 21:20:06
It's totally cryptic that we're making this seemin
H Fung
2013/09/21 01:13:25
I moved this into OmniboxEditModel::OnSetFocus(),
Peter Kasting
2013/09/21 01:15:55
OmniboxEditModel::UpdatePermanentText(), which is
| |
316 } | 318 } |
317 | 319 |
318 void AutocompleteController::StopZeroSuggest() { | 320 void AutocompleteController::StopZeroSuggest() { |
319 if (zero_suggest_provider_ != NULL) { | 321 if (zero_suggest_provider_ != NULL) { |
320 DCHECK(!in_start_); // We should not be already running a query. | 322 DCHECK(!in_start_); // We should not be already running a query. |
321 zero_suggest_provider_->Stop(false); | 323 zero_suggest_provider_->Stop(false); |
322 } | 324 } |
323 } | 325 } |
324 | 326 |
325 void AutocompleteController::DeleteMatch(const AutocompleteMatch& match) { | 327 void AutocompleteController::DeleteMatch(const AutocompleteMatch& match) { |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
635 // the disruptive effect of belated omnibox updates, updates that | 637 // the disruptive effect of belated omnibox updates, updates that |
636 // come after the user has had to time to read the whole dropdown | 638 // come after the user has had to time to read the whole dropdown |
637 // and doesn't expect it to change. | 639 // and doesn't expect it to change. |
638 const int kStopTimeMS = 1500; | 640 const int kStopTimeMS = 1500; |
639 stop_timer_.Start(FROM_HERE, | 641 stop_timer_.Start(FROM_HERE, |
640 base::TimeDelta::FromMilliseconds(kStopTimeMS), | 642 base::TimeDelta::FromMilliseconds(kStopTimeMS), |
641 base::Bind(&AutocompleteController::Stop, | 643 base::Bind(&AutocompleteController::Stop, |
642 base::Unretained(this), | 644 base::Unretained(this), |
643 false)); | 645 false)); |
644 } | 646 } |
OLD | NEW |