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/permission_request_creator_sync.
h" | 5 #include "chrome/browser/supervised_user/legacy/permission_request_creator_sync.
h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/callback.h" | 9 #include "base/callback.h" |
8 #include "base/values.h" | 10 #include "base/values.h" |
9 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" | 11 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" |
10 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" | 12 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" |
11 #include "components/browser_sync/browser/profile_sync_service.h" | 13 #include "components/browser_sync/browser/profile_sync_service.h" |
12 #include "google_apis/gaia/google_service_auth_error.h" | 14 #include "google_apis/gaia/google_service_auth_error.h" |
13 #include "net/base/escape.h" | 15 #include "net/base/escape.h" |
14 #include "url/gurl.h" | 16 #include "url/gurl.h" |
15 | 17 |
16 const char kSupervisedUserAccessRequestKeyPrefix[] = | 18 const char kSupervisedUserAccessRequestKeyPrefix[] = |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Copy the notification setting of the custodian. | 81 // Copy the notification setting of the custodian. |
80 const base::Value* value = shared_settings_service_->GetValue( | 82 const base::Value* value = shared_settings_service_->GetValue( |
81 supervised_user_id_, kNotificationSetting); | 83 supervised_user_id_, kNotificationSetting); |
82 bool notifications_enabled = false; | 84 bool notifications_enabled = false; |
83 if (value) { | 85 if (value) { |
84 bool success = value->GetAsBoolean(¬ifications_enabled); | 86 bool success = value->GetAsBoolean(¬ifications_enabled); |
85 DCHECK(success); | 87 DCHECK(success); |
86 } | 88 } |
87 dict->SetBoolean(kNotificationSetting, notifications_enabled); | 89 dict->SetBoolean(kNotificationSetting, notifications_enabled); |
88 | 90 |
89 settings_service_->UploadItem(key, dict.Pass()); | 91 settings_service_->UploadItem(key, std::move(dict)); |
90 | 92 |
91 callback.Run(true); | 93 callback.Run(true); |
92 } | 94 } |
OLD | NEW |