| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/extension_pref_value_map.h" | 5 #include "extensions/browser/extension_pref_value_map.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "components/prefs/pref_value_map.h" | 9 #include "components/prefs/pref_value_map.h" |
| 10 | 10 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 std::string ExtensionPrefValueMap::GetExtensionControllingPref( | 371 std::string ExtensionPrefValueMap::GetExtensionControllingPref( |
| 372 const std::string& pref_key) const { | 372 const std::string& pref_key) const { |
| 373 ExtensionEntryMap::const_iterator winner = | 373 ExtensionEntryMap::const_iterator winner = |
| 374 GetEffectivePrefValueController(pref_key, false, NULL); | 374 GetEffectivePrefValueController(pref_key, false, NULL); |
| 375 if (winner == entries_.end()) | 375 if (winner == entries_.end()) |
| 376 return std::string(); | 376 return std::string(); |
| 377 return winner->first; | 377 return winner->first; |
| 378 } | 378 } |
| 379 | 379 |
| 380 void ExtensionPrefValueMap::NotifyInitializationCompleted() { | 380 void ExtensionPrefValueMap::NotifyInitializationCompleted() { |
| 381 FOR_EACH_OBSERVER(ExtensionPrefValueMap::Observer, observers_, | 381 for (auto& observer : observers_) |
| 382 OnInitializationCompleted()); | 382 observer.OnInitializationCompleted(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 void ExtensionPrefValueMap::NotifyPrefValueChanged( | 385 void ExtensionPrefValueMap::NotifyPrefValueChanged( |
| 386 const std::set<std::string>& keys) { | 386 const std::set<std::string>& keys) { |
| 387 for (const auto& key : keys) | 387 for (const auto& key : keys) |
| 388 NotifyPrefValueChanged(key); | 388 NotifyPrefValueChanged(key); |
| 389 } | 389 } |
| 390 | 390 |
| 391 void ExtensionPrefValueMap::NotifyPrefValueChanged(const std::string& key) { | 391 void ExtensionPrefValueMap::NotifyPrefValueChanged(const std::string& key) { |
| 392 FOR_EACH_OBSERVER(ExtensionPrefValueMap::Observer, observers_, | 392 for (auto& observer : observers_) |
| 393 OnPrefValueChanged(key)); | 393 observer.OnPrefValueChanged(key); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void ExtensionPrefValueMap::NotifyOfDestruction() { | 396 void ExtensionPrefValueMap::NotifyOfDestruction() { |
| 397 FOR_EACH_OBSERVER(ExtensionPrefValueMap::Observer, observers_, | 397 for (auto& observer : observers_) |
| 398 OnExtensionPrefValueMapDestruction()); | 398 observer.OnExtensionPrefValueMapDestruction(); |
| 399 } | 399 } |
| OLD | NEW |