| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/common/get_client_auth_token.h" |
| 6 |
| 5 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 7 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 8 #include "blimp/common/get_client_token.h" | |
| 9 #include "blimp/common/switches.h" | 10 #include "blimp/common/switches.h" |
| 10 | 11 |
| 11 namespace blimp { | 12 namespace blimp { |
| 12 | 13 |
| 13 std::string GetClientToken(const base::CommandLine& cmd_line) { | 14 std::string GetClientAuthToken(const base::CommandLine& cmd_line) { |
| 14 std::string file_contents; | 15 std::string file_contents; |
| 15 const base::FilePath path = cmd_line.GetSwitchValuePath(kClientTokenPath); | 16 const base::FilePath path = cmd_line.GetSwitchValuePath(kClientAuthTokenPath); |
| 16 if (!base::ReadFileToString(path, &file_contents)) { | 17 if (!base::ReadFileToString(path, &file_contents)) { |
| 17 LOG(ERROR) << "Could not read client token file at " | 18 LOG(ERROR) << "Could not read client auth token file at " |
| 18 << (path.empty() ? "(not provided)" : path.AsUTF8Unsafe()); | 19 << (path.empty() ? "(not provided)" : path.AsUTF8Unsafe()); |
| 19 } | 20 } |
| 20 return base::CollapseWhitespaceASCII(file_contents, true); | 21 return base::CollapseWhitespaceASCII(file_contents, true); |
| 21 } | 22 } |
| 22 | 23 |
| 23 } // namespace blimp | 24 } // namespace blimp |
| OLD | NEW |