| 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/child_accounts/permission_request_creat
or_apiary.h" | 5 #include "chrome/browser/supervised_user/child_accounts/permission_request_creat
or_apiary.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 return true; | 110 return true; |
| 111 } | 111 } |
| 112 | 112 |
| 113 void PermissionRequestCreatorApiary::CreateURLAccessRequest( | 113 void PermissionRequestCreatorApiary::CreateURLAccessRequest( |
| 114 const GURL& url_requested, | 114 const GURL& url_requested, |
| 115 const SuccessCallback& callback) { | 115 const SuccessCallback& callback) { |
| 116 CreateRequest(kNamespaceURLRequest, url_requested.spec(), callback); | 116 CreateRequest(kNamespaceURLRequest, url_requested.spec(), callback); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void PermissionRequestCreatorApiary::CreateExtensionUpdateRequest( | 119 void PermissionRequestCreatorApiary::CreateExtensionUpdateRequest( |
| 120 const std::string& extension_id, | 120 const std::string& id, |
| 121 const SuccessCallback& callback) { | 121 const SuccessCallback& callback) { |
| 122 CreateRequest(kNamespaceUpdateRequest, extension_id, callback); | 122 CreateRequest(kNamespaceUpdateRequest, id, callback); |
| 123 } | 123 } |
| 124 | 124 |
| 125 GURL PermissionRequestCreatorApiary::GetApiUrl() const { | 125 GURL PermissionRequestCreatorApiary::GetApiUrl() const { |
| 126 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 126 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 127 switches::kPermissionRequestApiUrl)) { | 127 switches::kPermissionRequestApiUrl)) { |
| 128 GURL url(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 128 GURL url(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 129 switches::kPermissionRequestApiUrl)); | 129 switches::kPermissionRequestApiUrl)); |
| 130 LOG_IF(WARNING, !url.is_valid()) | 130 LOG_IF(WARNING, !url.is_valid()) |
| 131 << "Got invalid URL for " << switches::kPermissionRequestApiUrl; | 131 << "Got invalid URL for " << switches::kPermissionRequestApiUrl; |
| 132 return url; | 132 return url; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 it, GoogleServiceAuthError::FromConnectionError(error_code)); | 276 it, GoogleServiceAuthError::FromConnectionError(error_code)); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void PermissionRequestCreatorApiary::DispatchGoogleServiceAuthError( | 279 void PermissionRequestCreatorApiary::DispatchGoogleServiceAuthError( |
| 280 RequestIterator it, | 280 RequestIterator it, |
| 281 const GoogleServiceAuthError& error) { | 281 const GoogleServiceAuthError& error) { |
| 282 VLOG(1) << "GoogleServiceAuthError: " << error.ToString(); | 282 VLOG(1) << "GoogleServiceAuthError: " << error.ToString(); |
| 283 (*it)->callback.Run(false); | 283 (*it)->callback.Run(false); |
| 284 requests_.erase(it); | 284 requests_.erase(it); |
| 285 } | 285 } |
| OLD | NEW |