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

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

Issue 15701022: [Sync] Add support for sync Persistence Errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move bookmark change into separate patch Created 7 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 | 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 #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 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 current_data.push_back(CreateSyncDataFromTemplateURL(**iter)); 883 current_data.push_back(CreateSyncDataFromTemplateURL(**iter));
884 } 884 }
885 885
886 return current_data; 886 return current_data;
887 } 887 }
888 888
889 syncer::SyncError TemplateURLService::ProcessSyncChanges( 889 syncer::SyncError TemplateURLService::ProcessSyncChanges(
890 const tracked_objects::Location& from_here, 890 const tracked_objects::Location& from_here,
891 const syncer::SyncChangeList& change_list) { 891 const syncer::SyncChangeList& change_list) {
892 if (!models_associated_) { 892 if (!models_associated_) {
893 syncer::SyncError error(FROM_HERE, "Models not yet associated.", 893 syncer::SyncError error(FROM_HERE,
894 syncer::SEARCH_ENGINES); 894 syncer::SyncError::DATATYPE_ERROR,
895 "Models not yet associated.",
896 syncer::SEARCH_ENGINES);
895 return error; 897 return error;
896 } 898 }
897 DCHECK(loaded_); 899 DCHECK(loaded_);
898 900
899 base::AutoReset<bool> processing_changes(&processing_syncer_changes_, true); 901 base::AutoReset<bool> processing_changes(&processing_syncer_changes_, true);
900 902
901 // We've started syncing, so set our origin member to the base Sync value. 903 // We've started syncing, so set our origin member to the base Sync value.
902 // As we move through Sync Code, we may set this to increasingly specific 904 // As we move through Sync Code, we may set this to increasingly specific
903 // origins so we can tell what exactly caused a DSP change. 905 // origins so we can tell what exactly caused a DSP change.
904 base::AutoReset<DefaultSearchChangeOrigin> change_origin(&dsp_change_origin_, 906 base::AutoReset<DefaultSearchChangeOrigin> change_origin(&dsp_change_origin_,
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 // Don't log anything if the user has a NULL default search provider. A 2526 // Don't log anything if the user has a NULL default search provider. A
2525 // logged value of 0 indicates a custom default search provider. 2527 // logged value of 0 indicates a custom default search provider.
2526 if (default_search_provider_) { 2528 if (default_search_provider_) {
2527 UMA_HISTOGRAM_ENUMERATION( 2529 UMA_HISTOGRAM_ENUMERATION(
2528 kDSPHistogramName, 2530 kDSPHistogramName,
2529 default_search_provider_->prepopulate_id(), 2531 default_search_provider_->prepopulate_id(),
2530 TemplateURLPrepopulateData::kMaxPrepopulatedEngineID); 2532 TemplateURLPrepopulateData::kMaxPrepopulatedEngineID);
2531 } 2533 }
2532 } 2534 }
2533 } 2535 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_model_associator.cc ('k') | chrome/browser/search_engines/template_url_service_sync_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698