| 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 #ifndef CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_PERMISSION_REQUEST_CREATOR
_APIARY_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_PERMISSION_REQUEST_CREATOR
_APIARY_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_PERMISSION_REQUEST_CREATOR
_APIARY_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_PERMISSION_REQUEST_CREATOR
_APIARY_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "chrome/browser/supervised_user/permission_request_creator.h" | 13 #include "chrome/browser/supervised_user/permission_request_creator.h" |
| 14 #include "google_apis/gaia/oauth2_token_service.h" | 14 #include "google_apis/gaia/oauth2_token_service.h" |
| 15 #include "net/url_request/url_fetcher_delegate.h" | 15 #include "net/url_request/url_fetcher_delegate.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 class Profile; | 18 class Profile; |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class Time; | 21 class Time; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 class URLFetcher; | 25 class URLFetcher; |
| 26 class URLRequestContextGetter; | 26 class URLRequestContextGetter; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class PermissionRequestCreatorApiary : public PermissionRequestCreator, | 29 class PermissionRequestCreatorApiary : public PermissionRequestCreator, |
| 30 public OAuth2TokenService::Consumer, | 30 public OAuth2TokenService::Consumer, |
| 31 public net::URLFetcherDelegate { | 31 public net::URLFetcherDelegate { |
| 32 public: | 32 public: |
| 33 PermissionRequestCreatorApiary( | 33 PermissionRequestCreatorApiary( |
| 34 OAuth2TokenService* oauth2_token_service, | 34 OAuth2TokenService* oauth2_token_service, |
| 35 const std::string& account_id, | 35 const std::string& account_id, |
| 36 net::URLRequestContextGetter* context); | 36 net::URLRequestContextGetter* context); |
| 37 ~PermissionRequestCreatorApiary() override; | 37 ~PermissionRequestCreatorApiary() override; |
| 38 | 38 |
| 39 static scoped_ptr<PermissionRequestCreator> CreateWithProfile( | 39 static std::unique_ptr<PermissionRequestCreator> CreateWithProfile( |
| 40 Profile* profile); | 40 Profile* profile); |
| 41 | 41 |
| 42 // PermissionRequestCreator implementation: | 42 // PermissionRequestCreator implementation: |
| 43 bool IsEnabled() const override; | 43 bool IsEnabled() const override; |
| 44 void CreateURLAccessRequest(const GURL& url_requested, | 44 void CreateURLAccessRequest(const GURL& url_requested, |
| 45 const SuccessCallback& callback) override; | 45 const SuccessCallback& callback) override; |
| 46 void CreateExtensionUpdateRequest(const std::string& id, | 46 void CreateExtensionUpdateRequest(const std::string& id, |
| 47 const SuccessCallback& callback) override; | 47 const SuccessCallback& callback) override; |
| 48 | 48 |
| 49 void set_url_fetcher_id_for_testing(int id) { url_fetcher_id_ = id; } | 49 void set_url_fetcher_id_for_testing(int id) { url_fetcher_id_ = id; } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 79 std::string account_id_; | 79 std::string account_id_; |
| 80 net::URLRequestContextGetter* context_; | 80 net::URLRequestContextGetter* context_; |
| 81 int url_fetcher_id_; | 81 int url_fetcher_id_; |
| 82 | 82 |
| 83 ScopedVector<Request> requests_; | 83 ScopedVector<Request> requests_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(PermissionRequestCreatorApiary); | 85 DISALLOW_COPY_AND_ASSIGN(PermissionRequestCreatorApiary); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_PERMISSION_REQUEST_CREA
TOR_APIARY_H_ | 88 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_PERMISSION_REQUEST_CREA
TOR_APIARY_H_ |
| OLD | NEW |