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

Side by Side Diff: chrome/browser/search_engines/template_url_service.cc

Issue 340553005: Stop depending on TemplateURLService from DefaultSearchManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments 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/search_engines/template_url_service.h" 5 #include "chrome/browser/search_engines/template_url_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 const KeywordToTemplateMap::value_type& elem2) const { 223 const KeywordToTemplateMap::value_type& elem2) const {
224 return (elem1.second == NULL) ? 224 return (elem1.second == NULL) ?
225 (elem2.first.compare(0, elem1.first.length(), elem1.first) > 0) : 225 (elem2.first.compare(0, elem1.first.length(), elem1.first) > 0) :
226 (elem1.first < elem2.first); 226 (elem1.first < elem2.first);
227 } 227 }
228 }; 228 };
229 229
230 230
231 // TemplateURLService --------------------------------------------------------- 231 // TemplateURLService ---------------------------------------------------------
232 232
233 // static
234 bool TemplateURLService::g_fallback_search_engines_disabled = false;
235
236 TemplateURLService::TemplateURLService(Profile* profile) 233 TemplateURLService::TemplateURLService(Profile* profile)
237 : provider_map_(new SearchHostToURLsMap), 234 : provider_map_(new SearchHostToURLsMap),
238 profile_(profile), 235 profile_(profile),
239 search_terms_data_(new UIThreadSearchTermsData(profile)), 236 search_terms_data_(new UIThreadSearchTermsData(profile)),
240 loaded_(false), 237 loaded_(false),
241 load_failed_(false), 238 load_failed_(false),
242 load_handle_(0), 239 load_handle_(0),
243 default_search_provider_(NULL), 240 default_search_provider_(NULL),
244 next_id_(kInvalidTemplateURLID + 1), 241 next_id_(kInvalidTemplateURLID + 1),
245 time_provider_(&base::Time::Now), 242 time_provider_(&base::Time::Now),
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2538 2535
2539 if (most_recently_intalled_default) { 2536 if (most_recently_intalled_default) {
2540 base::AutoReset<DefaultSearchChangeOrigin> change_origin( 2537 base::AutoReset<DefaultSearchChangeOrigin> change_origin(
2541 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); 2538 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION);
2542 default_search_manager_.SetExtensionControlledDefaultSearchEngine( 2539 default_search_manager_.SetExtensionControlledDefaultSearchEngine(
2543 most_recently_intalled_default->data()); 2540 most_recently_intalled_default->data());
2544 } else { 2541 } else {
2545 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); 2542 default_search_manager_.ClearExtensionControlledDefaultSearchEngine();
2546 } 2543 }
2547 } 2544 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698