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

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

Issue 7314018: Don't autocomplete searches of >1 word if they've only been visited once and the user has not yet... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 url, 552 url,
553 languages, 553 languages,
554 net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP), 554 net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP),
555 UnescapeRule::SPACES, NULL, NULL, NULL); 555 UnescapeRule::SPACES, NULL, NULL, NULL);
556 } 556 }
557 557
558 // AutocompleteResult --------------------------------------------------------- 558 // AutocompleteResult ---------------------------------------------------------
559 559
560 // static 560 // static
561 const size_t AutocompleteResult::kMaxMatches = 6; 561 const size_t AutocompleteResult::kMaxMatches = 6;
562 const int AutocompleteResult::kLowestDefaultScore = 1200;
562 563
563 void AutocompleteResult::Selection::Clear() { 564 void AutocompleteResult::Selection::Clear() {
564 destination_url = GURL(); 565 destination_url = GURL();
565 provider_affinity = NULL; 566 provider_affinity = NULL;
566 is_history_what_you_typed_match = false; 567 is_history_what_you_typed_match = false;
567 } 568 }
568 569
569 AutocompleteResult::AutocompleteResult() { 570 AutocompleteResult::AutocompleteResult() {
570 // Reserve space for the max number of matches we'll show. 571 // Reserve space for the max number of matches we'll show.
571 matches_.reserve(kMaxMatches); 572 matches_.reserve(kMaxMatches);
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 } 1028 }
1028 } 1029 }
1029 done_ = true; 1030 done_ = true;
1030 } 1031 }
1031 1032
1032 void AutocompleteController::StartExpireTimer() { 1033 void AutocompleteController::StartExpireTimer() {
1033 if (result_.HasCopiedMatches()) 1034 if (result_.HasCopiedMatches())
1034 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS), 1035 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS),
1035 this, &AutocompleteController::ExpireCopiedEntries); 1036 this, &AutocompleteController::ExpireCopiedEntries);
1036 } 1037 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698