summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/cros/cros_library_loader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/cros/cros_library_loader.cc')
-rw-r--r--chrome/browser/chromeos/cros/cros_library_loader.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/cros/cros_library_loader.cc b/chrome/browser/chromeos/cros/cros_library_loader.cc
new file mode 100644
index 0000000..a542802
--- /dev/null
+++ b/chrome/browser/chromeos/cros/cros_library_loader.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/cros/cros_library_loader.h"
+
+#include <dlfcn.h>
+
+#include "base/file_path.h"
+#include "base/logging.h"
+#include "base/path_service.h"
+#include "chrome/common/chrome_paths.h"
+#include "cros/chromeos_cros_api.h"
+
+namespace chromeos {
+
+bool CrosLibraryLoader::Load(std::string* load_error_string) {
+ bool loaded = false;
+ FilePath path;
+ if (PathService::Get(chrome::FILE_CHROMEOS_API, &path))
+ loaded = LoadLibcros(path.value().c_str(), *load_error_string);
+
+ if (!loaded) {
+ LOG(ERROR) << "Problem loading chromeos shared object: "
+ << *load_error_string;
+ }
+ return loaded;
+}
+
+} // namespace chromeos
+