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

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

Issue 8334030: Merge search engines sync data type with Preferences. Sync the default search provider. Add some ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 108905)
+++ chrome/browser/search_engines/template_url_service.h (working copy)
@@ -336,8 +336,6 @@
FindDuplicateOfSyncTemplateURL);
FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
MergeSyncAndLocalURLDuplicates);
- FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
- CreateGUIDToSyncDataMap);
friend class TemplateURLServiceTestUtil;
@@ -496,6 +494,14 @@
TemplateURL* local_url,
SyncChangeList* change_list);
+ // Checks a newly added TemplateURL from Sync by its sync_guid and sets it as
+ // the default search provider if we were waiting for it.
+ void CheckForSyncedDefaultSearchProvider(const std::string& guid);
jeanluc1 2011/11/08 19:49:41 Seems like the "sets it as the default" is the mor
SteveT 2011/11/08 21:40:04 Agreed. Done.
+
+ // Retrieve the pending default search provider according to Sync. Returns
+ // NULL if there was no pending search provider from Sync.
+ const TemplateURL* GetPendingSyncedDefaultSearchProvder();
+
content::NotificationRegistrar registrar_;
// Mapping from keyword to the TemplateURL.
@@ -574,6 +580,12 @@
// Sync's SyncChange handler. We push all our changes through this.
SyncChangeProcessor* sync_processor_;
+ // Whether or not we are waiting on the default search provider to come in
+ // from Sync. This is to facilitate the fact that changes to the value of
+ // prefs::kSyncedDefaultSearchProviderGUID do not always come before the
+ // TemplateURL entry it refers to.
Nicolas Zea 2011/11/08 19:57:27 As I understand it, this is not only for when we'r
SteveT 2011/11/08 21:40:04 Yeah, that's correct. Beefed up the comment.
+ bool pending_synced_default_search_;
+
DISALLOW_COPY_AND_ASSIGN(TemplateURLService);
};

Powered by Google App Engine
This is Rietveld 408576698