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

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

Issue 12377080: Don't log anything if the user has a NULL default search provider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment. Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 #include "chrome/browser/search_engines/template_url_service.h" 5 #include "chrome/browser/search_engines/template_url_service.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 bool has_default_search_provider = default_search_provider_ != NULL && 819 bool has_default_search_provider = default_search_provider_ != NULL &&
820 default_search_provider_->SupportsReplacement(); 820 default_search_provider_->SupportsReplacement();
821 UMA_HISTOGRAM_BOOLEAN(kHasDSPHistogramName, 821 UMA_HISTOGRAM_BOOLEAN(kHasDSPHistogramName,
822 has_default_search_provider); 822 has_default_search_provider);
823 // Ensure that default search provider exists. See http://crbug.com/116952. 823 // Ensure that default search provider exists. See http://crbug.com/116952.
824 if (!has_default_search_provider) { 824 if (!has_default_search_provider) {
825 bool success = 825 bool success =
826 SetDefaultSearchProviderNoNotify(FindNewDefaultSearchProvider()); 826 SetDefaultSearchProviderNoNotify(FindNewDefaultSearchProvider());
827 DCHECK(success); 827 DCHECK(success);
828 } 828 }
829 UMA_HISTOGRAM_ENUMERATION( 829 // Don't log anything if the user has a NULL default search provider. A
830 kDSPHistogramName, 830 // logged value of 0 indicates a custom default search provider.
831 default_search_provider_ ? 831 if (default_search_provider_) {
832 default_search_provider_->prepopulate_id() : 0, 832 UMA_HISTOGRAM_ENUMERATION(
833 TemplateURLPrepopulateData::kMaxPrepopulatedEngineID); 833 kDSPHistogramName,
834 default_search_provider_->prepopulate_id(),
835 TemplateURLPrepopulateData::kMaxPrepopulatedEngineID);
836 }
834 } 837 }
835 838
836 NotifyObservers(); 839 NotifyObservers();
837 NotifyLoaded(); 840 NotifyLoaded();
838 } 841 }
839 842
840 string16 TemplateURLService::GetKeywordShortName(const string16& keyword, 843 string16 TemplateURLService::GetKeywordShortName(const string16& keyword,
841 bool* is_extension_keyword) { 844 bool* is_extension_keyword) {
842 const TemplateURL* template_url = GetTemplateURLForKeyword(keyword); 845 const TemplateURL* template_url = GetTemplateURLForKeyword(keyword);
843 846
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after
2537 // TODO(mpcomplete): If we allow editing extension keywords, then those 2540 // TODO(mpcomplete): If we allow editing extension keywords, then those
2538 // should be persisted to disk and synced. 2541 // should be persisted to disk and synced.
2539 if (template_url->sync_guid().empty() && 2542 if (template_url->sync_guid().empty() &&
2540 !template_url->IsExtensionKeyword()) { 2543 !template_url->IsExtensionKeyword()) {
2541 template_url->data_.sync_guid = base::GenerateGUID(); 2544 template_url->data_.sync_guid = base::GenerateGUID();
2542 if (service_.get()) 2545 if (service_.get())
2543 service_->UpdateKeyword(template_url->data()); 2546 service_->UpdateKeyword(template_url->data());
2544 } 2547 }
2545 } 2548 }
2546 } 2549 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698