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

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

Issue 10049005: Fix homepage migration for users who never changed their settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Value -> base::Value Created 8 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 #include "chrome/browser/protector/protected_prefs_watcher.h" 5 #include "chrome/browser/protector/protected_prefs_watcher.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const content::NotificationSource& source, 144 const content::NotificationSource& source,
145 const content::NotificationDetails& details) { 145 const content::NotificationDetails& details) {
146 DCHECK(type == chrome::NOTIFICATION_PREF_CHANGED); 146 DCHECK(type == chrome::NOTIFICATION_PREF_CHANGED);
147 const std::string* pref_name = content::Details<std::string>(details).ptr(); 147 const std::string* pref_name = content::Details<std::string>(details).ptr();
148 DCHECK(pref_name && pref_observer_->IsObserved(*pref_name)); 148 DCHECK(pref_name && pref_observer_->IsObserved(*pref_name));
149 if (UpdateBackupEntry(*pref_name)) 149 if (UpdateBackupEntry(*pref_name))
150 UpdateBackupSignature(); 150 UpdateBackupSignature();
151 } 151 }
152 152
153 void ProtectedPrefsWatcher::EnsurePrefsMigration() { 153 void ProtectedPrefsWatcher::EnsurePrefsMigration() {
154 // Force SessionStartupPref migration, if necessary. 154 SessionStartupPref::MigrateIfNecessary(profile_->GetPrefs());
155 SessionStartupPref::GetStartupPref(profile_);
156 } 155 }
157 156
158 bool ProtectedPrefsWatcher::UpdateCachedPrefs() { 157 bool ProtectedPrefsWatcher::UpdateCachedPrefs() {
159 // Direct access to the extensions prefs is required becase ExtensionService 158 // Direct access to the extensions prefs is required becase ExtensionService
160 // may not yet have been initialized. 159 // may not yet have been initialized.
161 ExtensionPrefs::ExtensionIdSet extension_ids = 160 ExtensionPrefs::ExtensionIdSet extension_ids =
162 ExtensionPrefs::GetExtensionsFrom( 161 ExtensionPrefs::GetExtensionsFrom(
163 profile_->GetPrefs()->GetDictionary(ExtensionPrefs::kExtensionsPref)); 162 profile_->GetPrefs()->GetDictionary(ExtensionPrefs::kExtensionsPref));
164 if (extension_ids == cached_extension_ids_) 163 if (extension_ids == cached_extension_ids_)
165 return false; 164 return false;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 NOTREACHED(); 331 NOTREACHED();
333 continue; 332 continue;
334 } 333 }
335 StringAppendStringDictionary(tab, &data); 334 StringAppendStringDictionary(tab, &data);
336 } 335 }
337 } 336 }
338 return data; 337 return data;
339 } 338 }
340 339
341 } // namespace protector 340 } // namespace protector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698