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

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

Issue 10384188: Ensure that TemplateURLs removed by prepopulate search engine merging is also removed from Sync. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: removed AddPreSyncDeletedGUIDForTesting; test empty set; merge to TOT Created 8 years, 7 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 #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 <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 CreateSyncDataFromTemplateURL); 347 CreateSyncDataFromTemplateURL);
348 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 348 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
349 CreateTemplateURLFromSyncData); 349 CreateTemplateURLFromSyncData);
350 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, UniquifyKeyword); 350 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, UniquifyKeyword);
351 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 351 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
352 ResolveSyncKeywordConflict); 352 ResolveSyncKeywordConflict);
353 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 353 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
354 FindDuplicateOfSyncTemplateURL); 354 FindDuplicateOfSyncTemplateURL);
355 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 355 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
356 MergeSyncAndLocalURLDuplicates); 356 MergeSyncAndLocalURLDuplicates);
357 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
358 PreSyncDeletes);
357 359
358 friend class TemplateURLServiceTestUtil; 360 friend class TemplateURLServiceTestUtil;
359 361
360 typedef std::map<string16, TemplateURL*> KeywordToTemplateMap; 362 typedef std::map<string16, TemplateURL*> KeywordToTemplateMap;
361 typedef std::map<std::string, TemplateURL*> GUIDToTemplateMap; 363 typedef std::map<std::string, TemplateURL*> GUIDToTemplateMap;
362 typedef std::list<std::string> PendingExtensionIDs; 364 typedef std::list<std::string> PendingExtensionIDs;
363 365
364 // Helper functor for FindMatchingKeywords(), for finding the range of 366 // Helper functor for FindMatchingKeywords(), for finding the range of
365 // keywords which begin with a prefix. 367 // keywords which begin with a prefix.
366 class LessWithPrefix; 368 class LessWithPrefix;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 // Sync's error handler. We use it to create a sync error. 623 // Sync's error handler. We use it to create a sync error.
622 scoped_ptr<SyncErrorFactory> sync_error_factory_; 624 scoped_ptr<SyncErrorFactory> sync_error_factory_;
623 625
624 // Whether or not we are waiting on the default search provider to come in 626 // Whether or not we are waiting on the default search provider to come in
625 // from Sync. This is to facilitate the fact that changes to the value of 627 // from Sync. This is to facilitate the fact that changes to the value of
626 // prefs::kSyncedDefaultSearchProviderGUID do not always come before the 628 // prefs::kSyncedDefaultSearchProviderGUID do not always come before the
627 // TemplateURL entry it refers to, and to handle the case when we want to use 629 // TemplateURL entry it refers to, and to handle the case when we want to use
628 // the Synced default when the default search provider becomes unmanaged. 630 // the Synced default when the default search provider becomes unmanaged.
629 bool pending_synced_default_search_; 631 bool pending_synced_default_search_;
630 632
633 // A set of sync GUIDs denoting TemplateURLs that have been removed from this
634 // model or the underlying WebDataService prior to MergeDataAndStartSyncing.
635 // This set is used to determine what entries from the server we want to
636 // ignore locally and return a delete command for.
637 std::set<std::string> pre_sync_deletes_;
638
631 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); 639 DISALLOW_COPY_AND_ASSIGN(TemplateURLService);
632 }; 640 };
633 641
634 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 642 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/search_provider_install_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