| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 CertLibrary* GetCertLibrary(); | 72 CertLibrary* GetCertLibrary(); |
| 73 CryptohomeLibrary* GetCryptohomeLibrary(); | 73 CryptohomeLibrary* GetCryptohomeLibrary(); |
| 74 NetworkLibrary* GetNetworkLibrary(); | 74 NetworkLibrary* GetNetworkLibrary(); |
| 75 PowerLibrary* GetPowerLibrary(); | 75 PowerLibrary* GetPowerLibrary(); |
| 76 ScreenLockLibrary* GetScreenLockLibrary(); | 76 ScreenLockLibrary* GetScreenLockLibrary(); |
| 77 UpdateLibrary* GetUpdateLibrary(); | 77 UpdateLibrary* GetUpdateLibrary(); |
| 78 | 78 |
| 79 // Getter for Test API that gives access to internal members of this class. | 79 // Getter for Test API that gives access to internal members of this class. |
| 80 TestApi* GetTestApi(); | 80 TestApi* GetTestApi(); |
| 81 | 81 |
| 82 // TODO(stevenjb): Deprecate this. Libraries should fall back to stub | |
| 83 // implementations if libcros_loaded() is false, and/or use libcros_loaded() | |
| 84 // to protect calls to libcros. http://crosbug.com/19886 | |
| 85 bool EnsureLoaded() { return use_stub_impl_ || libcros_loaded_; } | |
| 86 | |
| 87 bool libcros_loaded() { return libcros_loaded_; } | 82 bool libcros_loaded() { return libcros_loaded_; } |
| 88 | 83 |
| 89 // Returns an unlocalized string describing the last load error (if any). | 84 // Returns an unlocalized string describing the last load error (if any). |
| 90 const std::string& load_error_string() { | 85 const std::string& load_error_string() { |
| 91 return load_error_string_; | 86 return load_error_string_; |
| 92 } | 87 } |
| 93 | 88 |
| 94 private: | 89 private: |
| 95 friend struct base::DefaultLazyInstanceTraits<chromeos::CrosLibrary>; | 90 friend struct base::DefaultLazyInstanceTraits<chromeos::CrosLibrary>; |
| 96 friend class CrosLibrary::TestApi; | 91 friend class CrosLibrary::TestApi; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 chromeos::CrosLibrary::Shutdown(); | 166 chromeos::CrosLibrary::Shutdown(); |
| 172 } | 167 } |
| 173 | 168 |
| 174 private: | 169 private: |
| 175 DISALLOW_COPY_AND_ASSIGN(ScopedStubCrosEnabler); | 170 DISALLOW_COPY_AND_ASSIGN(ScopedStubCrosEnabler); |
| 176 }; | 171 }; |
| 177 | 172 |
| 178 } // namespace chromeos | 173 } // namespace chromeos |
| 179 | 174 |
| 180 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ | 175 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ |
| OLD | NEW |