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

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

Issue 1028123002: Supervised users: Include extension version in update requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit_tests Created 5 years, 9 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/permission_request_creator_sync. h" 5 #include "chrome/browser/supervised_user/legacy/permission_request_creator_sync. h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #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"
10 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" 10 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void PermissionRequestCreatorSync::CreateURLAccessRequest( 51 void PermissionRequestCreatorSync::CreateURLAccessRequest(
52 const GURL& url_requested, 52 const GURL& url_requested,
53 const SuccessCallback& callback) { 53 const SuccessCallback& callback) {
54 CreateRequest(kSupervisedUserAccessRequestKeyPrefix, 54 CreateRequest(kSupervisedUserAccessRequestKeyPrefix,
55 url_requested.spec(), 55 url_requested.spec(),
56 callback); 56 callback);
57 } 57 }
58 58
59 void PermissionRequestCreatorSync::CreateExtensionUpdateRequest( 59 void PermissionRequestCreatorSync::CreateExtensionUpdateRequest(
60 const std::string& extension_id, 60 const std::string& id,
61 const SuccessCallback& callback) { 61 const SuccessCallback& callback) {
62 CreateRequest(kSupervisedUserUpdateRequestKeyPrefix, extension_id, callback); 62 CreateRequest(kSupervisedUserUpdateRequestKeyPrefix, id, callback);
63 } 63 }
64 64
65 void PermissionRequestCreatorSync::CreateRequest( 65 void PermissionRequestCreatorSync::CreateRequest(
66 const std::string& prefix, 66 const std::string& prefix,
67 const std::string& data, 67 const std::string& data,
68 const SuccessCallback& callback) { 68 const SuccessCallback& callback) {
69 // Escape the data string and add the prefix. 69 // Escape the data string and add the prefix.
70 std::string key = SupervisedUserSettingsService::MakeSplitSettingKey( 70 std::string key = SupervisedUserSettingsService::MakeSplitSettingKey(
71 prefix, 71 prefix,
72 net::EscapeQueryParamValue(data, true)); 72 net::EscapeQueryParamValue(data, true));
(...skipping 11 matching lines...) Expand all
84 if (value) { 84 if (value) {
85 bool success = value->GetAsBoolean(&notifications_enabled); 85 bool success = value->GetAsBoolean(&notifications_enabled);
86 DCHECK(success); 86 DCHECK(success);
87 } 87 }
88 dict->SetBoolean(kNotificationSetting, notifications_enabled); 88 dict->SetBoolean(kNotificationSetting, notifications_enabled);
89 89
90 settings_service_->UploadItem(key, dict.Pass()); 90 settings_service_->UploadItem(key, dict.Pass());
91 91
92 callback.Run(true); 92 callback.Run(true);
93 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698