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

Side by Side Diff: chrome/browser/sync/glue/preference_model_associator.cc

Issue 6248017: Do not use local override for language settings: always sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bs removed Created 9 years, 11 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/profiles/profile_impl.cc ('k') | chrome/common/pref_names.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/sync/glue/preference_model_associator.h" 5 #include "chrome/browser/sync/glue/preference_model_associator.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 14 matching lines...) Expand all
25 ProfileSyncService* sync_service) 25 ProfileSyncService* sync_service)
26 : sync_service_(sync_service), 26 : sync_service_(sync_service),
27 preferences_node_id_(sync_api::kInvalidId) { 27 preferences_node_id_(sync_api::kInvalidId) {
28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
29 DCHECK(sync_service_); 29 DCHECK(sync_service_);
30 30
31 // Add the list of kSynchronizedPreferences to our local 31 // Add the list of kSynchronizedPreferences to our local
32 // synced_preferences set, taking care to filter out any preferences 32 // synced_preferences set, taking care to filter out any preferences
33 // that are not registered. 33 // that are not registered.
34 PrefService* pref_service = sync_service_->profile()->GetPrefs(); 34 PrefService* pref_service = sync_service_->profile()->GetPrefs();
35 for (size_t i = 0; 35 for (size_t i = 0; i < arraysize(kSynchronizedPreferences); ++i) {
36 i < static_cast<size_t>(arraysize(kSynchronizedPreferences)); ++i) {
37 if (pref_service->FindPreference(kSynchronizedPreferences[i])) 36 if (pref_service->FindPreference(kSynchronizedPreferences[i]))
38 synced_preferences_.insert(kSynchronizedPreferences[i]); 37 synced_preferences_.insert(kSynchronizedPreferences[i]);
39 } 38 }
40 } 39 }
41 40
42 PreferenceModelAssociator::~PreferenceModelAssociator() { 41 PreferenceModelAssociator::~PreferenceModelAssociator() {
43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
44 } 43 }
45 44
46 bool PreferenceModelAssociator::InitPrefNodeAndAssociate( 45 bool PreferenceModelAssociator::InitPrefNodeAndAssociate(
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // notification to update the UI. 313 // notification to update the UI.
315 if (0 == pref_name.compare(prefs::kShowBookmarkBar)) { 314 if (0 == pref_name.compare(prefs::kShowBookmarkBar)) {
316 NotificationService::current()->Notify( 315 NotificationService::current()->Notify(
317 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, 316 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
318 Source<PreferenceModelAssociator>(this), 317 Source<PreferenceModelAssociator>(this),
319 NotificationService::NoDetails()); 318 NotificationService::NoDetails());
320 } 319 }
321 } 320 }
322 321
323 } // namespace browser_sync 322 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698