| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "google_apis/gaia/fake_gaia.h" | 5 #include "google_apis/gaia/fake_gaia.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 http_response->set_code(net::HTTP_OK); | 518 http_response->set_code(net::HTTP_OK); |
| 519 http_response->set_content(embedded_setup_chromeos_response_); | 519 http_response->set_content(embedded_setup_chromeos_response_); |
| 520 http_response->set_content_type("text/html"); | 520 http_response->set_content_type("text/html"); |
| 521 } | 521 } |
| 522 | 522 |
| 523 void FakeGaia::HandleOAuthLogin(const HttpRequest& request, | 523 void FakeGaia::HandleOAuthLogin(const HttpRequest& request, |
| 524 BasicHttpResponse* http_response) { | 524 BasicHttpResponse* http_response) { |
| 525 http_response->set_code(net::HTTP_UNAUTHORIZED); | 525 http_response->set_code(net::HTTP_UNAUTHORIZED); |
| 526 if (merge_session_params_.gaia_uber_token.empty()) { | 526 if (merge_session_params_.gaia_uber_token.empty()) { |
| 527 http_response->set_code(net::HTTP_FORBIDDEN); | 527 http_response->set_code(net::HTTP_FORBIDDEN); |
| 528 http_response->set_content("Error=BadAuthentication"); |
| 528 return; | 529 return; |
| 529 } | 530 } |
| 530 | 531 |
| 531 std::string access_token; | 532 std::string access_token; |
| 532 if (!GetAccessToken(request, kAuthHeaderBearer, &access_token) && | 533 if (!GetAccessToken(request, kAuthHeaderBearer, &access_token) && |
| 533 !GetAccessToken(request, kAuthHeaderOAuth, &access_token)) { | 534 !GetAccessToken(request, kAuthHeaderOAuth, &access_token)) { |
| 534 LOG(ERROR) << "/OAuthLogin missing access token in the header"; | 535 LOG(ERROR) << "/OAuthLogin missing access token in the header"; |
| 535 return; | 536 return; |
| 536 } | 537 } |
| 537 | 538 |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 http_response->AddCustomHeader("Google-Accounts-SAML", "Start"); | 847 http_response->AddCustomHeader("Google-Accounts-SAML", "Start"); |
| 847 http_response->AddCustomHeader("Location", redirect_url); | 848 http_response->AddCustomHeader("Location", redirect_url); |
| 848 } | 849 } |
| 849 | 850 |
| 850 void FakeGaia::HandleGetCheckConnectionInfo( | 851 void FakeGaia::HandleGetCheckConnectionInfo( |
| 851 const net::test_server::HttpRequest& request, | 852 const net::test_server::HttpRequest& request, |
| 852 net::test_server::BasicHttpResponse* http_response) { | 853 net::test_server::BasicHttpResponse* http_response) { |
| 853 base::ListValue connection_list; | 854 base::ListValue connection_list; |
| 854 FormatJSONResponse(connection_list, http_response); | 855 FormatJSONResponse(connection_list, http_response); |
| 855 } | 856 } |
| OLD | NEW |