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

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

Issue 7064052: Revert 88142 to fix sync_integration_tests offline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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/builtin_provider.h" 5 #include "chrome/browser/autocomplete/builtin_provider.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/autocomplete/autocomplete_match.h" 9 #include "chrome/browser/autocomplete/autocomplete_match.h"
10 #include "chrome/browser/browser_about_handler.h" 10 #include "chrome/browser/browser_about_handler.h"
11 #include "chrome/browser/net/url_fixer_upper.h" 11 #include "chrome/browser/net/url_fixer_upper.h"
12 12
13 const int BuiltinProvider::kRelevance = 575; 13 const int BuiltinProvider::kRelevance = 575;
14 14
15 BuiltinProvider::BuiltinProvider(ACProviderListener* listener, 15 BuiltinProvider::BuiltinProvider(ACProviderListener* listener,
16 Profile* profile) 16 Profile* profile)
17 : AutocompleteProvider(listener, profile, "Builtin") { 17 : AutocompleteProvider(listener, profile, "Builtin") {
18 std::vector<std::string> builtins(ChromePaths()); 18 std::vector<std::string> builtins(AboutPaths());
19 for (std::vector<std::string>::iterator i(builtins.begin()); 19 for (std::vector<std::string>::iterator i(builtins.begin());
20 i != builtins.end(); ++i) 20 i != builtins.end(); ++i)
21 builtins_.push_back(ASCIIToUTF16("about:") + ASCIIToUTF16(*i)); 21 builtins_.push_back(ASCIIToUTF16("about:") + ASCIIToUTF16(*i));
22 } 22 }
23 23
24 BuiltinProvider::~BuiltinProvider() {} 24 BuiltinProvider::~BuiltinProvider() {}
25 25
26 void BuiltinProvider::Start(const AutocompleteInput& input, 26 void BuiltinProvider::Start(const AutocompleteInput& input,
27 bool minimal_changes) { 27 bool minimal_changes) {
28 matches_.clear(); 28 matches_.clear();
(...skipping 16 matching lines...) Expand all
45 match.contents_class.push_back( 45 match.contents_class.push_back(
46 ACMatchClassification(input.text().length(), 46 ACMatchClassification(input.text().length(),
47 ACMatchClassification::URL)); 47 ACMatchClassification::URL));
48 } 48 }
49 matches_.push_back(match); 49 matches_.push_back(match);
50 } 50 }
51 } 51 }
52 for (size_t i = 0; i < matches_.size(); ++i) 52 for (size_t i = 0; i < matches_.size(); ++i)
53 matches_[i].relevance = kRelevance + matches_.size() - (i + 1); 53 matches_[i].relevance = kRelevance + matches_.size() - (i + 1);
54 } 54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698