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

Side by Side Diff: chrome/browser/autocomplete/shortcuts_provider.h

Issue 10701043: Make ShortcutsBackend a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/shortcuts_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // {{0, MATCH}, {2, NONE}, {12, MATCH}, {14, NONE}, {18, URL|MATCH}, 66 // {{0, MATCH}, {2, NONE}, {12, MATCH}, {14, NONE}, {18, URL|MATCH},
67 // {20, URL}, {37, NONE}} 67 // {20, URL}, {37, NONE}}
68 static ACMatchClassifications ClassifyAllMatchesInString( 68 static ACMatchClassifications ClassifyAllMatchesInString(
69 const string16& find_text, 69 const string16& find_text,
70 const string16& text, 70 const string16& text,
71 const ACMatchClassifications& original_class); 71 const ACMatchClassifications& original_class);
72 72
73 // Returns iterator to first item in |shortcuts_map_| matching |keyword|. 73 // Returns iterator to first item in |shortcuts_map_| matching |keyword|.
74 // Returns shortcuts_map_.end() if there are no matches. 74 // Returns shortcuts_map_.end() if there are no matches.
75 history::ShortcutsBackend::ShortcutMap::const_iterator FindFirstMatch( 75 history::ShortcutsBackend::ShortcutMap::const_iterator FindFirstMatch(
76 const string16& keyword); 76 const string16& keyword,
77 history::ShortcutsBackend* backend);
77 78
78 static int CalculateScore( 79 static int CalculateScore(
79 const string16& terms, 80 const string16& terms,
80 const history::ShortcutsBackend::Shortcut& shortcut); 81 const history::ShortcutsBackend::Shortcut& shortcut);
81 82
82 // For unit-test only.
83 void set_shortcuts_backend(history::ShortcutsBackend* shortcuts_backend);
84
85 std::string languages_; 83 std::string languages_;
86 bool initialized_; 84 bool initialized_;
87
88 scoped_refptr<history::ShortcutsBackend> shortcuts_backend_;
89 }; 85 };
90 86
91 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ 87 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/shortcuts_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698