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/search_provider.h" | 5 #include "chrome/browser/autocomplete/search_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 keyword_navigation_results_.clear(); | 528 keyword_navigation_results_.clear(); |
529 default_navigation_results_.clear(); | 529 default_navigation_results_.clear(); |
530 have_suggest_results_ = false; | 530 have_suggest_results_ = false; |
531 } | 531 } |
532 | 532 |
533 net::URLFetcher* SearchProvider::CreateSuggestFetcher( | 533 net::URLFetcher* SearchProvider::CreateSuggestFetcher( |
534 int id, | 534 int id, |
535 const TemplateURLRef& suggestions_url, | 535 const TemplateURLRef& suggestions_url, |
536 const string16& text) { | 536 const string16& text) { |
537 DCHECK(suggestions_url.SupportsReplacement()); | 537 DCHECK(suggestions_url.SupportsReplacement()); |
538 content::URLFetcher* fetcher = content::URLFetcher::Create(id, | 538 net::URLFetcher* fetcher = content::URLFetcher::Create(id, |
539 GURL(suggestions_url.ReplaceSearchTerms(text, | 539 GURL(suggestions_url.ReplaceSearchTerms(text, |
540 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())), | 540 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())), |
541 content::URLFetcher::GET, this); | 541 net::URLFetcher::GET, this); |
542 fetcher->SetRequestContext(profile_->GetRequestContext()); | 542 fetcher->SetRequestContext(profile_->GetRequestContext()); |
543 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); | 543 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); |
544 fetcher->Start(); | 544 fetcher->Start(); |
545 return fetcher; | 545 return fetcher; |
546 } | 546 } |
547 | 547 |
548 bool SearchProvider::ParseSuggestResults(Value* root_val, | 548 bool SearchProvider::ParseSuggestResults(Value* root_val, |
549 bool is_keyword, | 549 bool is_keyword, |
550 const string16& input_text, | 550 const string16& input_text, |
551 SuggestResults* suggest_results) { | 551 SuggestResults* suggest_results) { |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 | 995 |
996 return match; | 996 return match; |
997 } | 997 } |
998 | 998 |
999 void SearchProvider::UpdateDone() { | 999 void SearchProvider::UpdateDone() { |
1000 // We're done when there are no more suggest queries pending (this is set to 1 | 1000 // We're done when there are no more suggest queries pending (this is set to 1 |
1001 // when the timer is started) and we're not waiting on instant. | 1001 // when the timer is started) and we're not waiting on instant. |
1002 done_ = ((suggest_results_pending_ == 0) && | 1002 done_ = ((suggest_results_pending_ == 0) && |
1003 (instant_finalized_ || !InstantController::IsEnabled(profile_))); | 1003 (instant_finalized_ || !InstantController::IsEnabled(profile_))); |
1004 } | 1004 } |
OLD | NEW |