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

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

Issue 330233002: Create a new component "autocomplete" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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) 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/bookmark_provider.h" 5 #include "chrome/browser/autocomplete/bookmark_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/browser/autocomplete/autocomplete_result.h" 13 #include "chrome/browser/autocomplete/autocomplete_result.h"
14 #include "chrome/browser/autocomplete/history_provider.h" 14 #include "chrome/browser/autocomplete/history_provider.h"
15 #include "chrome/browser/autocomplete/url_prefix.h"
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
17 #include "chrome/browser/omnibox/omnibox_field_trial.h" 16 #include "chrome/browser/omnibox/omnibox_field_trial.h"
18 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
19 #include "components/autocomplete/url_prefix.h"
20 #include "components/bookmarks/browser/bookmark_match.h" 20 #include "components/bookmarks/browser/bookmark_match.h"
21 #include "components/bookmarks/browser/bookmark_model.h" 21 #include "components/bookmarks/browser/bookmark_model.h"
22 #include "components/metrics/proto/omnibox_input_type.pb.h" 22 #include "components/metrics/proto/omnibox_input_type.pb.h"
23 #include "net/base/net_util.h" 23 #include "net/base/net_util.h"
24 24
25 using bookmarks::BookmarkMatch; 25 using bookmarks::BookmarkMatch;
26 26
27 typedef std::vector<BookmarkMatch> BookmarkMatches; 27 typedef std::vector<BookmarkMatch> BookmarkMatches;
28 28
29 // BookmarkProvider ------------------------------------------------------------ 29 // BookmarkProvider ------------------------------------------------------------
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 i != positions.end(); 312 i != positions.end();
313 ++i) { 313 ++i) {
314 AutocompleteMatch::ACMatchClassifications new_class; 314 AutocompleteMatch::ACMatchClassifications new_class;
315 AutocompleteMatch::ClassifyLocationInString(i->first, i->second - i->first, 315 AutocompleteMatch::ClassifyLocationInString(i->first, i->second - i->first,
316 text_length, url_style, &new_class); 316 text_length, url_style, &new_class);
317 classifications = AutocompleteMatch::MergeClassifications( 317 classifications = AutocompleteMatch::MergeClassifications(
318 classifications, new_class); 318 classifications, new_class);
319 } 319 }
320 return classifications; 320 return classifications;
321 } 321 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698