Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3380)

Unified Diff: chrome/browser/chromeos/cros_library.cc

Issue 251099: Refactor cros library code into central location and have the UI elements obs... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/cros_library.h ('k') | chrome/browser/chromeos/cros_network_library.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros_library.cc
===================================================================
--- chrome/browser/chromeos/cros_library.cc (revision 0)
+++ chrome/browser/chromeos/cros_library.cc (revision 0)
@@ -0,0 +1,34 @@
+// Copyright (c) 2009 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_library.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 "third_party/cros/chromeos_cros_api.h"
+
+// static
+bool CrosLibrary::loaded_ = false;
+
+// static
+bool CrosLibrary::loaded() {
+ static bool initialized = false;
+ if (!initialized) {
+ FilePath path;
+ if (PathService::Get(chrome::FILE_CHROMEOS_API, &path))
+ loaded_ = chromeos::LoadCros(path.value().c_str());
+
+ if (!loaded_) {
+ char* error = dlerror();
+ if (error)
+ LOG(ERROR) << "Problem loading chromeos shared object: " << error;
+ }
+ initialized = true;
+ }
+ return loaded_;
+}
Property changes on: chrome/browser/chromeos/cros_library.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/chromeos/cros_library.h ('k') | chrome/browser/chromeos/cros_network_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698