OLD | NEW |
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 } |
OLD | NEW |