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

Side by Side Diff: chrome/browser/protector/protector_service.cc

Issue 10170046: [protector] Bump Preferences backup version to 3 to mitigate the startup prefs migration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/protector/protector_service.h ('k') | 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/protector/protector_service.h" 5 #include "chrome/browser/protector/protector_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/google/google_util.h" 8 #include "chrome/browser/google/google_util.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/protector/composite_settings_change.h" 10 #include "chrome/browser/protector/composite_settings_change.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 void ProtectorService::OpenTab(const GURL& url, Browser* browser) { 113 void ProtectorService::OpenTab(const GURL& url, Browser* browser) {
114 DCHECK(browser); 114 DCHECK(browser);
115 browser->ShowSingletonTab(url); 115 browser->ShowSingletonTab(url);
116 } 116 }
117 117
118 ProtectedPrefsWatcher* ProtectorService::GetPrefsWatcher() { 118 ProtectedPrefsWatcher* ProtectorService::GetPrefsWatcher() {
119 return prefs_watcher_.get(); 119 return prefs_watcher_.get();
120 } 120 }
121 121
122 void ProtectorService::StopWatchingPrefsForTesting() {
123 prefs_watcher_.reset();
124 }
125
122 ProtectorService::Item* ProtectorService::FindItemToMergeWith( 126 ProtectorService::Item* ProtectorService::FindItemToMergeWith(
123 const BaseSettingChange* change) { 127 const BaseSettingChange* change) {
124 if (!change->CanBeMerged()) 128 if (!change->CanBeMerged())
125 return NULL; 129 return NULL;
126 GURL url = change->GetNewSettingURL(); 130 GURL url = change->GetNewSettingURL();
127 for (Items::iterator item = items_.begin(); item != items_.end(); item++) { 131 for (Items::iterator item = items_.begin(); item != items_.end(); item++) {
128 if (item->change->CanBeMerged() && 132 if (item->change->CanBeMerged() &&
129 CanMerge(url, item->change->GetNewSettingURL())) 133 CanMerge(url, item->change->GetNewSettingURL()))
130 return &*item; 134 return &*item;
131 } 135 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 ProtectorService::MatchItemByError::MatchItemByError( 216 ProtectorService::MatchItemByError::MatchItemByError(
213 const SettingsChangeGlobalError* other) : other_(other) { 217 const SettingsChangeGlobalError* other) : other_(other) {
214 } 218 }
215 219
216 bool ProtectorService::MatchItemByError::operator()( 220 bool ProtectorService::MatchItemByError::operator()(
217 const ProtectorService::Item& item) { 221 const ProtectorService::Item& item) {
218 return other_ == item.error.get(); 222 return other_ == item.error.get();
219 } 223 }
220 224
221 } // namespace protector 225 } // namespace protector
OLDNEW
« no previous file with comments | « chrome/browser/protector/protector_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698