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

Unified Diff: chrome/browser/search_engines/template_url_service.h

Issue 9982018: Move most TemplateURL data members to a new struct, TemplateURLData. This allows us to eliminate t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search_engines/template_url_service.h
===================================================================
--- chrome/browser/search_engines/template_url_service.h (revision 130759)
+++ chrome/browser/search_engines/template_url_service.h (working copy)
@@ -141,6 +141,13 @@
// Takes ownership of |template_url| and adds it to this model.
void Add(TemplateURL* template_url);
+ // Like Add(), but overwrites the |template_url|'s values with the provided
+ // ones.
+ void AddWithOverrides(const TemplateURL* template_url,
+ const string16& short_name,
+ const string16& keyword,
+ const std::string& url);
+
// Removes the keyword from the model. This deletes the supplied TemplateURL.
// This fails if the supplied template_url is the default search provider.
void Remove(const TemplateURL* template_url);
@@ -290,10 +297,12 @@
// from |turl|.
static SyncData CreateSyncDataFromTemplateURL(const TemplateURL& turl);
- // Returns a heap-allocated TemplateURL, populated by |sync_data|'s fields.
- // This does the opposite of CreateSyncDataFromTemplateURL. The caller owns
- // the returned TemplateURL*.
- static TemplateURL* CreateTemplateURLFromSyncData(const SyncData& sync_data);
+ // Creates a new heap-allocated TemplateURL* which is populated by overlaying
+ // |sync_data| atop |existing_turl|. |existing_turl| may be NULL; if not it
+ // remains unmodified. The caller owns the returned TemplateURL*.
+ static TemplateURL* CreateTemplateURLFromTemplateURLAndSyncData(
+ const TemplateURL* existing_turl,
+ const SyncData& sync_data);
// Returns a map mapping Sync GUIDs to pointers to SyncData.
static SyncDataMap CreateGUIDToSyncDataMap(const SyncDataList& sync_data);
@@ -507,11 +516,6 @@
// where old entries were being pushed to Sync without a sync_guid.
void PatchMissingSyncGUIDs(std::vector<TemplateURL*>* template_urls);
- // Overwrites |dst|'s synced fields with values from |sync_data|. This does
- // commit |dst| to the TemplateURLService.
- static void UpdateTemplateURLWithSyncData(TemplateURL* dst,
- const SyncData& sync_data);
-
content::NotificationRegistrar registrar_;
// Mapping from keyword to the TemplateURL.
« no previous file with comments | « chrome/browser/search_engines/template_url_prepopulate_data.cc ('k') | chrome/browser/search_engines/template_url_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698