| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "chromeos_cros_api.h" // NOLINT | 7 #include "chromeos_cros_api.h" // NOLINT |
| 8 | 8 |
| 9 // Construct a path for the shared library. This example uses a local path | 9 // Construct a path for the shared library. This example uses a local path |
| 10 // but on chromeos the library is installed in: | 10 // but on chromeos the library is installed in: |
| 11 // "/opt/google/chrome/chromeos/libcros.so" | 11 // "/opt/google/chrome/chromeos/libcros.so" |
| 12 bool LoadCrosLibrary(const char** argv) { | 12 bool LoadCrosLibrary(const char** argv) { |
| 13 std::string app_path = argv[0]; | 13 std::string app_path = argv[0]; |
| 14 app_path.erase(app_path.begin() + app_path.find_last_of("/"), app_path.end()); | 14 app_path.erase(app_path.begin() + app_path.find_last_of("/"), app_path.end()); |
| 15 app_path += "/libcros.so"; | 15 app_path += "/libcros.so"; |
| 16 | 16 |
| 17 bool success = chromeos::LoadCros(app_path.c_str()); | 17 std::string error_string = std::string(); |
| 18 DCHECK(success) << "LoadCros('" << app_path.c_str() << "') failed."; | 18 bool success = chromeos::LoadLibcros(app_path.c_str(), error_string); |
| 19 DCHECK(success) << "LoadLibcros('" << app_path.c_str() << "') failed: " |
| 20 << error_string; |
| 19 return true; | 21 return true; |
| 20 } | 22 } |
| OLD | NEW |