OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 568 |
569 string16 AutocompleteProvider::StringForURLDisplay(const GURL& url, | 569 string16 AutocompleteProvider::StringForURLDisplay(const GURL& url, |
570 bool check_accept_lang, | 570 bool check_accept_lang, |
571 bool trim_http) const { | 571 bool trim_http) const { |
572 std::string languages = (check_accept_lang && profile_) ? | 572 std::string languages = (check_accept_lang && profile_) ? |
573 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) : std::string(); | 573 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) : std::string(); |
574 return net::FormatUrl( | 574 return net::FormatUrl( |
575 url, | 575 url, |
576 languages, | 576 languages, |
577 net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP), | 577 net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP), |
578 UnescapeRule::SPACES, NULL, NULL, NULL); | 578 net::UnescapeRule::SPACES, NULL, NULL, NULL); |
579 } | 579 } |
580 | 580 |
581 // AutocompleteResult --------------------------------------------------------- | 581 // AutocompleteResult --------------------------------------------------------- |
582 | 582 |
583 // static | 583 // static |
584 const size_t AutocompleteResult::kMaxMatches = 6; | 584 const size_t AutocompleteResult::kMaxMatches = 6; |
585 const int AutocompleteResult::kLowestDefaultScore = 1200; | 585 const int AutocompleteResult::kLowestDefaultScore = 1200; |
586 | 586 |
587 void AutocompleteResult::Selection::Clear() { | 587 void AutocompleteResult::Selection::Clear() { |
588 destination_url = GURL(); | 588 destination_url = GURL(); |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 } | 1056 } |
1057 done_ = true; | 1057 done_ = true; |
1058 } | 1058 } |
1059 | 1059 |
1060 void AutocompleteController::StartExpireTimer() { | 1060 void AutocompleteController::StartExpireTimer() { |
1061 if (result_.HasCopiedMatches()) | 1061 if (result_.HasCopiedMatches()) |
1062 expire_timer_.Start(FROM_HERE, | 1062 expire_timer_.Start(FROM_HERE, |
1063 base::TimeDelta::FromMilliseconds(kExpireTimeMS), | 1063 base::TimeDelta::FromMilliseconds(kExpireTimeMS), |
1064 this, &AutocompleteController::ExpireCopiedEntries); | 1064 this, &AutocompleteController::ExpireCopiedEntries); |
1065 } | 1065 } |
OLD | NEW |