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

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

Issue 7232023: Added last_modified field to TemplateURL and database. Updated unit tests, including refactoring ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Initial upload. 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 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 search_engine_dialog_chosen_slot_ = slot; 233 search_engine_dialog_chosen_slot_ = slot;
234 } 234 }
235 235
236 int GetSearchEngineDialogSlot() const { 236 int GetSearchEngineDialogSlot() const {
237 return search_engine_dialog_chosen_slot_; 237 return search_engine_dialog_chosen_slot_;
238 } 238 }
239 239
240 // Registers the preferences used to save a TemplateURL to prefs. 240 // Registers the preferences used to save a TemplateURL to prefs.
241 static void RegisterUserPrefs(PrefService* prefs); 241 static void RegisterUserPrefs(PrefService* prefs);
242 242
243 // Type for a static function pointer that acts as a time source.
244 typedef base::Time(TimeProvider)();
sky 2011/06/22 22:38:06 Move this to other typedefs above.
SteveT 2011/06/23 21:15:55 Done.
245
246 // The following is for testing.
247 void InstallTimeProvider(TimeProvider* time_provider);
248 // Replaces |time_provider_| with the default value, &base::Time::Now.
249 void UninstallTimeProvider();
250
243 protected: 251 protected:
244 // Cover method for the method of the same name on the HistoryService. 252 // Cover method for the method of the same name on the HistoryService.
245 // url is the one that was visited with the given search terms. 253 // url is the one that was visited with the given search terms.
246 // 254 //
247 // This exists and is virtual for testing. 255 // This exists and is virtual for testing.
248 virtual void SetKeywordSearchTermsForURL(const TemplateURL* t_url, 256 virtual void SetKeywordSearchTermsForURL(const TemplateURL* t_url,
249 const GURL& url, 257 const GURL& url,
250 const string16& term); 258 const string16& term);
251 259
252 private: 260 private:
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 // preferences have changed. 441 // preferences have changed.
434 scoped_ptr<PrefSetObserver> default_search_prefs_; 442 scoped_ptr<PrefSetObserver> default_search_prefs_;
435 443
436 // ID assigned to next TemplateURL added to this model. This is an ever 444 // ID assigned to next TemplateURL added to this model. This is an ever
437 // increasing integer that is initialized from the database. 445 // increasing integer that is initialized from the database.
438 TemplateURLID next_id_; 446 TemplateURLID next_id_;
439 447
440 // List of extension IDs waiting for Load to have keywords registered. 448 // List of extension IDs waiting for Load to have keywords registered.
441 std::vector<std::string> pending_extension_ids_; 449 std::vector<std::string> pending_extension_ids_;
442 450
451 // Function returning current time in base::Time units.
452 TimeProvider* time_provider_;
453
443 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); 454 DISALLOW_COPY_AND_ASSIGN(TemplateURLService);
444 }; 455 };
445 456
446 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 457 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698