| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/strings/string_number_conversions.h" |
| 6 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 7 #include "base/values.h" | 8 #include "base/values.h" |
| 8 #include "chrome/browser/local_discovery/cloud_print_base_api_flow.h" | 9 #include "chrome/browser/local_discovery/cloud_print_base_api_flow.h" |
| 9 #include "chrome/common/cloud_print/cloud_print_constants.h" | 10 #include "chrome/common/cloud_print/cloud_print_constants.h" |
| 10 #include "google_apis/gaia/google_service_auth_error.h" | 11 #include "google_apis/gaia/google_service_auth_error.h" |
| 11 #include "net/base/load_flags.h" | 12 #include "net/base/load_flags.h" |
| 13 #include "net/base/url_util.h" |
| 12 #include "net/http/http_status_code.h" | 14 #include "net/http/http_status_code.h" |
| 13 #include "net/url_request/url_request_status.h" | 15 #include "net/url_request/url_request_status.h" |
| 14 #include "base/strings/string_number_conversions.h" | |
| 15 #include "net/base/url_util.h" | |
| 16 | 16 |
| 17 namespace local_discovery { | 17 namespace local_discovery { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 const char kCloudPrintOAuthHeaderFormat[] = "Authorization: Bearer %s"; | 20 const char kCloudPrintOAuthHeaderFormat[] = "Authorization: Bearer %s"; |
| 21 const char kXSRFURLParameterKey[] = "xsrf"; | 21 const char kXSRFURLParameterKey[] = "xsrf"; |
| 22 const char kUserURLParameterKey[] = "user"; | 22 const char kUserURLParameterKey[] = "user"; |
| 23 } | 23 } |
| 24 | 24 |
| 25 CloudPrintBaseApiFlow::CloudPrintBaseApiFlow( | 25 CloudPrintBaseApiFlow::CloudPrintBaseApiFlow( |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 if (!value || !value->GetAsDictionary(&dictionary_value)) { | 147 if (!value || !value->GetAsDictionary(&dictionary_value)) { |
| 148 delegate_->OnCloudPrintAPIFlowError(this, ERROR_MALFORMED_RESPONSE); | 148 delegate_->OnCloudPrintAPIFlowError(this, ERROR_MALFORMED_RESPONSE); |
| 149 return; | 149 return; |
| 150 } | 150 } |
| 151 | 151 |
| 152 delegate_->OnCloudPrintAPIFlowComplete(this, dictionary_value); | 152 delegate_->OnCloudPrintAPIFlowComplete(this, dictionary_value); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace local_discovery | 155 } // namespace local_discovery |
| OLD | NEW |