Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / chrome / browser / supervised_user / legacy / permission_request_creator_sync.h
blob6bfbc197a0865e6348ede3d48e9925c203aa3957
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SUPERVISED_USER_LEGACY_PERMISSION_REQUEST_CREATOR_SYNC_H_
6 #define CHROME_BROWSER_SUPERVISED_USER_LEGACY_PERMISSION_REQUEST_CREATOR_SYNC_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/supervised_user/permission_request_creator.h"
13 class ProfileSyncService;
14 class SupervisedUserSettingsService;
15 class SupervisedUserSharedSettingsService;
17 // The requests are stored using a prefix followed by a URIEncoded version of
18 // the URL/extension ID. Each entry contains a dictionary which currently has
19 // the timestamp of the request in it.
20 class PermissionRequestCreatorSync : public PermissionRequestCreator {
21 public:
22 PermissionRequestCreatorSync(
23 SupervisedUserSettingsService* settings_service,
24 SupervisedUserSharedSettingsService* shared_settings_service,
25 ProfileSyncService* sync_service,
26 const std::string& name,
27 const std::string& supervised_user_id);
28 ~PermissionRequestCreatorSync() override;
30 // PermissionRequestCreator implementation:
31 bool IsEnabled() const override;
32 void CreateURLAccessRequest(const GURL& url_requested,
33 const SuccessCallback& callback) override;
34 void CreateExtensionUpdateRequest(const std::string& id,
35 const SuccessCallback& callback) override;
37 private:
38 // Note: Doesn't escape |data|. If you need it escaped, do it yourself!
39 void CreateRequest(const std::string& prefix,
40 const std::string& data,
41 const SuccessCallback& callback);
42 SupervisedUserSettingsService* settings_service_;
43 SupervisedUserSharedSettingsService* shared_settings_service_;
44 ProfileSyncService* sync_service_;
45 std::string name_;
46 std::string supervised_user_id_;
49 #endif // CHROME_BROWSER_SUPERVISED_USER_LEGACY_PERMISSION_REQUEST_CREATOR_SYNC_H_