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

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

Issue 229763005: Store default search provider data in dictionary pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: put constants in a namespace Created 6 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 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 #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 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 const base::string16& term); 383 const base::string16& term);
384 384
385 private: 385 private:
386 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, TestManagedDefaultSearch); 386 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, TestManagedDefaultSearch);
387 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, 387 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest,
388 UpdateKeywordSearchTermsForURL); 388 UpdateKeywordSearchTermsForURL);
389 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, 389 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest,
390 DontUpdateKeywordSearchForNonReplaceable); 390 DontUpdateKeywordSearchForNonReplaceable);
391 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, ChangeGoogleBaseValue); 391 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, ChangeGoogleBaseValue);
392 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, MergeDeletesUnusedProviders); 392 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, MergeDeletesUnusedProviders);
393 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceTest, PrefSaving);
393 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 394 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
394 CreateSyncDataFromTemplateURL); 395 CreateSyncDataFromTemplateURL);
395 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 396 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
396 CreateTemplateURLFromSyncData); 397 CreateTemplateURLFromSyncData);
397 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, UniquifyKeyword); 398 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, UniquifyKeyword);
398 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 399 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
399 ResolveSyncKeywordConflict); 400 ResolveSyncKeywordConflict);
400 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, PreSyncDeletes); 401 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, PreSyncDeletes);
401 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, 402 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest,
402 IsLocalTemplateURLBetter); 403 IsLocalTemplateURLBetter);
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 // that supports replacement and wants to be default, if any. 676 // that supports replacement and wants to be default, if any.
676 TemplateURL* FindExtensionDefaultSearchEngine() const; 677 TemplateURL* FindExtensionDefaultSearchEngine() const;
677 678
678 // Sets the default search provider to: 679 // Sets the default search provider to:
679 // (1) BestDefaultExtensionControlledTURL(), if any; or, 680 // (1) BestDefaultExtensionControlledTURL(), if any; or,
680 // (2) LoadDefaultSearchProviderFromPrefs(), if we have a TURL with that ID; 681 // (2) LoadDefaultSearchProviderFromPrefs(), if we have a TURL with that ID;
681 // or, 682 // or,
682 // (3) FindNewDefaultSearchProvider(). 683 // (3) FindNewDefaultSearchProvider().
683 void SetDefaultSearchProviderAfterRemovingDefaultExtension(); 684 void SetDefaultSearchProviderAfterRemovingDefaultExtension();
684 685
686 bool ReadDataFromPrefsDictionary(TemplateURL** url);
687
688 void WriteDataToPrefsDictionary(const TemplateURL* url);
689
685 content::NotificationRegistrar notification_registrar_; 690 content::NotificationRegistrar notification_registrar_;
686 PrefChangeRegistrar pref_change_registrar_; 691 PrefChangeRegistrar pref_change_registrar_;
687 692
688 // Mapping from keyword to the TemplateURL. 693 // Mapping from keyword to the TemplateURL.
689 KeywordToTemplateMap keyword_to_template_map_; 694 KeywordToTemplateMap keyword_to_template_map_;
690 695
691 // Mapping from Sync GUIDs to the TemplateURL. 696 // Mapping from Sync GUIDs to the TemplateURL.
692 GUIDToTemplateMap guid_to_template_map_; 697 GUIDToTemplateMap guid_to_template_map_;
693 698
694 TemplateURLVector template_urls_; 699 TemplateURLVector template_urls_;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 // cause/origin of a default search change. 778 // cause/origin of a default search change.
774 DefaultSearchChangeOrigin dsp_change_origin_; 779 DefaultSearchChangeOrigin dsp_change_origin_;
775 780
776 // Stores a list of callbacks to be run after TemplateURLService has loaded. 781 // Stores a list of callbacks to be run after TemplateURLService has loaded.
777 base::CallbackList<void(void)> on_loaded_callbacks_; 782 base::CallbackList<void(void)> on_loaded_callbacks_;
778 783
779 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); 784 DISALLOW_COPY_AND_ASSIGN(TemplateURLService);
780 }; 785 };
781 786
782 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 787 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698