| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/common/net/url_request_context_getter.h" | 10 #include "chrome/common/net/url_request_context_getter.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 void RemotingDirectoryService::OnURLFetchComplete( | 68 void RemotingDirectoryService::OnURLFetchComplete( |
| 69 const URLFetcher* source, | 69 const URLFetcher* source, |
| 70 const GURL& url, | 70 const GURL& url, |
| 71 const URLRequestStatus& status, | 71 const URLRequestStatus& status, |
| 72 int response_code, | 72 int response_code, |
| 73 const ResponseCookies& cookies, | 73 const ResponseCookies& cookies, |
| 74 const std::string& data) { | 74 const std::string& data) { |
| 75 // Destroy the fetcher after the response has been received. | 75 // Destroy the fetcher after the response has been received. |
| 76 fetcher_.reset(); | 76 fetcher_.reset(); |
| 77 | 77 |
| 78 LOG(INFO) << "Remoting directory response: \n" << data.c_str(); | 78 // TODO(hclam): Simply checking 200 status is not enough. |
| 79 | |
| 80 // TODO(hclam): Simply checking 200 status is not ennough. | |
| 81 if (response_code == 200) { | 79 if (response_code == 200) { |
| 82 client_->OnRemotingHostAdded(); | 80 client_->OnRemotingHostAdded(); |
| 83 } else { | 81 } else { |
| 84 client_->OnRemotingDirectoryError(); | 82 client_->OnRemotingDirectoryError(); |
| 85 } | 83 } |
| 86 } | 84 } |
| OLD | NEW |