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

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

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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
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/shortcuts_backend.h" 5 #include "chrome/browser/autocomplete/shortcuts_backend.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 history::ShortcutsDatabase::Shortcut::MatchCore 145 history::ShortcutsDatabase::Shortcut::MatchCore
146 ShortcutsBackend::MatchToMatchCore(const AutocompleteMatch& match, 146 ShortcutsBackend::MatchToMatchCore(const AutocompleteMatch& match,
147 Profile* profile) { 147 Profile* profile) {
148 const AutocompleteMatch::Type match_type = GetTypeForShortcut(match.type); 148 const AutocompleteMatch::Type match_type = GetTypeForShortcut(match.type);
149 TemplateURLService* service = 149 TemplateURLService* service =
150 TemplateURLServiceFactory::GetForProfile(profile); 150 TemplateURLServiceFactory::GetForProfile(profile);
151 const AutocompleteMatch& normalized_match = 151 const AutocompleteMatch& normalized_match =
152 AutocompleteMatch::IsSpecializedSearchType(match.type) ? 152 AutocompleteMatch::IsSpecializedSearchType(match.type) ?
153 BaseSearchProvider::CreateSearchSuggestion( 153 BaseSearchProvider::CreateSearchSuggestion(
154 match.search_terms_args->search_terms, match_type, 154 match.search_terms_args->search_terms, match_type,
155 (match.transition == content::PAGE_TRANSITION_KEYWORD), 155 (match.transition == ui::PAGE_TRANSITION_KEYWORD),
156 match.GetTemplateURL(service, false), 156 match.GetTemplateURL(service, false),
157 UIThreadSearchTermsData(profile)) : 157 UIThreadSearchTermsData(profile)) :
158 match; 158 match;
159 return history::ShortcutsDatabase::Shortcut::MatchCore( 159 return history::ShortcutsDatabase::Shortcut::MatchCore(
160 normalized_match.fill_into_edit, normalized_match.destination_url, 160 normalized_match.fill_into_edit, normalized_match.destination_url,
161 normalized_match.contents, 161 normalized_match.contents,
162 StripMatchMarkers(normalized_match.contents_class), 162 StripMatchMarkers(normalized_match.contents_class),
163 normalized_match.description, 163 normalized_match.description,
164 StripMatchMarkers(normalized_match.description_class), 164 StripMatchMarkers(normalized_match.description_class),
165 normalized_match.transition, match_type, normalized_match.keyword); 165 normalized_match.transition, match_type, normalized_match.keyword);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 guid_map_.clear(); 321 guid_map_.clear();
322 FOR_EACH_OBSERVER(ShortcutsBackendObserver, observer_list_, 322 FOR_EACH_OBSERVER(ShortcutsBackendObserver, observer_list_,
323 OnShortcutsChanged()); 323 OnShortcutsChanged());
324 return no_db_access_ || 324 return no_db_access_ ||
325 BrowserThread::PostTask( 325 BrowserThread::PostTask(
326 BrowserThread::DB, FROM_HERE, 326 BrowserThread::DB, FROM_HERE,
327 base::Bind(base::IgnoreResult( 327 base::Bind(base::IgnoreResult(
328 &history::ShortcutsDatabase::DeleteAllShortcuts), 328 &history::ShortcutsDatabase::DeleteAllShortcuts),
329 db_.get())); 329 db_.get()));
330 } 330 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider_unittest.cc ('k') | chrome/browser/autocomplete/shortcuts_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698