OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/prefs/pref_model_associator_client.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 PrefModelAssociatorClient::PrefModelAssociatorClient() {} |
| 10 |
| 11 PrefModelAssociatorClient::~PrefModelAssociatorClient() {} |
| 12 |
| 13 void PrefModelAssociatorClient::RegisterPreference( |
| 14 const std::string& pref_name, |
| 15 PrefModelAssociatorPreferenceType pref_type) { |
| 16 DCHECK(pref_registry_.find(pref_name) == pref_registry_.end()); |
| 17 pref_registry_[pref_name] = pref_type; |
| 18 } |
| 19 |
| 20 bool PrefModelAssociatorClient::IsPreferenceMerged( |
| 21 const std::string& pref_name, |
| 22 PrefModelAssociatorPreferenceType* pref_type) { |
| 23 auto iter = pref_registry_.find(pref_name); |
| 24 if (iter == pref_registry_.end()) |
| 25 return false; |
| 26 *pref_type = iter->second; |
| 27 return true; |
| 28 } |
OLD | NEW |