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

Side by Side Diff: chrome/browser/prefs/scoped_pref_update.cc

Issue 5441002: Clean up pref change notification handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix extension prefs breakage Created 10 years 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) 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/prefs/scoped_pref_update.h" 5 #include "chrome/browser/prefs/scoped_pref_update.h"
6 6
7 #include "chrome/browser/prefs/pref_notifier.h" 7 #include "chrome/browser/prefs/pref_notifier.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 9
10 ScopedPrefUpdate::ScopedPrefUpdate(PrefService* service, const char* path) 10 ScopedPrefUpdate::ScopedPrefUpdate(PrefService* service, const char* path)
11 : service_(service), 11 : service_(service),
12 path_(path) {} 12 path_(path) {}
13 13
14 ScopedPrefUpdate::~ScopedPrefUpdate() { 14 ScopedPrefUpdate::~ScopedPrefUpdate() {
15 service_->pref_notifier()->FireObservers(path_.c_str()); 15 // TODO(mnissler, danno): This sends a notification unconditionally, which is
16 // wrong. We should rather tell the PrefService that the user pref got
17 // updated.
18 service_->pref_notifier()->OnPreferenceChanged(path_.c_str());
16 } 19 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_value_store_unittest.cc ('k') | chrome/browser/prefs/testing_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698