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

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

Issue 10694096: Made the deletion of the default search provider defensive in TemplateURLService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: typo fix Created 8 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/search_engines/template_url_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 TemplateURL* default_from_prefs); 521 TemplateURL* default_from_prefs);
522 522
523 // Resets the sync GUID of the specified TemplateURL and persists the change 523 // Resets the sync GUID of the specified TemplateURL and persists the change
524 // to the database. This does not notify observers. 524 // to the database. This does not notify observers.
525 void ResetTemplateURLGUID(TemplateURL* url, const std::string& guid); 525 void ResetTemplateURLGUID(TemplateURL* url, const std::string& guid);
526 526
527 // Attempts to generate a unique keyword for |turl| based on its original 527 // Attempts to generate a unique keyword for |turl| based on its original
528 // keyword. If its keyword is already unique, that is returned. Otherwise, it 528 // keyword. If its keyword is already unique, that is returned. Otherwise, it
529 // tries to return the autogenerated keyword if that is unique to the Service, 529 // tries to return the autogenerated keyword if that is unique to the Service,
530 // and finally it repeatedly appends special characters to the keyword until 530 // and finally it repeatedly appends special characters to the keyword until
531 // it is unique to the Service. 531 // it is unique to the Service. If |force| is true, then this will only
532 string16 UniquifyKeyword(const TemplateURL& turl); 532 // execute the special character appending functionality.
533 string16 UniquifyKeyword(const TemplateURL& turl, bool force);
533 534
534 // Given a TemplateURL from Sync (cloud) and a local, non-extension 535 // Given a TemplateURL from Sync (cloud) and a local, non-extension
535 // TemplateURL with the same keyword, selects "better" and "worse" entries: 536 // TemplateURL with the same keyword, selects "better" and "worse" entries:
536 // * If one of the TemplateURLs is replaceable and the other is not, the 537 // * If one of the TemplateURLs is replaceable and the other is not, the
537 // non-replaceable entry is better. 538 // non-replaceable entry is better.
538 // * Otherwise, if |local_turl| was created by policy, is the default 539 // * Otherwise, if |local_turl| was created by policy, is the default
539 // provider, or was modified more recently, it is better. 540 // provider, or was modified more recently, it is better.
540 // * Otherwise |sync_turl| is better. 541 // * Otherwise |sync_turl| is better.
541 // Then resolves the conflict: 542 // Then resolves the conflict:
542 // * If the "worse" entry is |sync_turl|, and it is replaceable, add a 543 // * If the "worse" entry is |sync_turl|, and it is replaceable, add a
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 680
680 // This is used to log the origin of changes to the default search provider. 681 // This is used to log the origin of changes to the default search provider.
681 // We set this value to increasingly specific values when we know what is the 682 // We set this value to increasingly specific values when we know what is the
682 // cause/origin of a default search change. 683 // cause/origin of a default search change.
683 DefaultSearchChangeOrigin dsp_change_origin_; 684 DefaultSearchChangeOrigin dsp_change_origin_;
684 685
685 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); 686 DISALLOW_COPY_AND_ASSIGN(TemplateURLService);
686 }; 687 };
687 688
688 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 689 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/search_engines/template_url_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698