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

Side by Side Diff: chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_service.cc

Issue 1658793002: Update chrome for new prefs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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
OLDNEW
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
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(&current_avatar_index); 87 bool success = value->GetAsInteger(&current_avatar_index);
88 DCHECK(success); 88 DCHECK(success);
89 return current_avatar_index; 89 return current_avatar_index;
90 } 90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698