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 "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice.h" | 5 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/prefs/pref_service.h" | |
9 #include "base/values.h" | 8 #include "base/values.h" |
10 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" | 9 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" |
11 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 10 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
12 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 #include "components/prefs/pref_service.h" |
13 | 13 |
14 const int kNoAvatar = -1; | 14 const int kNoAvatar = -1; |
15 | 15 |
16 SupervisedUserPrefMappingService::SupervisedUserPrefMappingService( | 16 SupervisedUserPrefMappingService::SupervisedUserPrefMappingService( |
17 PrefService* prefs, | 17 PrefService* prefs, |
18 SupervisedUserSharedSettingsService* shared_settings) | 18 SupervisedUserSharedSettingsService* shared_settings) |
19 : prefs_(prefs), | 19 : prefs_(prefs), |
20 shared_settings_(shared_settings), | 20 shared_settings_(shared_settings), |
21 supervised_user_id_(prefs->GetString(prefs::kSupervisedUserId)), | 21 supervised_user_id_(prefs->GetString(prefs::kSupervisedUserId)), |
22 weak_ptr_factory_(this) {} | 22 weak_ptr_factory_(this) {} |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const base::Value* value = shared_settings_->GetValue( | 81 const base::Value* value = shared_settings_->GetValue( |
82 supervised_user_id_, supervised_users::kChromeAvatarIndex); | 82 supervised_user_id_, supervised_users::kChromeAvatarIndex); |
83 if (!value) | 83 if (!value) |
84 return kNoAvatar; | 84 return kNoAvatar; |
85 | 85 |
86 int current_avatar_index; | 86 int current_avatar_index; |
87 bool success = value->GetAsInteger(¤t_avatar_index); | 87 bool success = value->GetAsInteger(¤t_avatar_index); |
88 DCHECK(success); | 88 DCHECK(success); |
89 return current_avatar_index; | 89 return current_avatar_index; |
90 } | 90 } |
OLD | NEW |