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

Side by Side Diff: chrome/browser/chromeos/cros/cros_library.h

Issue 8588006: Eliminate CrosLibrary::EnsureLoaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 CryptohomeLibrary* GetCryptohomeLibrary(); 75 CryptohomeLibrary* GetCryptohomeLibrary();
76 MountLibrary* GetMountLibrary(); 76 MountLibrary* GetMountLibrary();
77 NetworkLibrary* GetNetworkLibrary(); 77 NetworkLibrary* GetNetworkLibrary();
78 PowerLibrary* GetPowerLibrary(); 78 PowerLibrary* GetPowerLibrary();
79 ScreenLockLibrary* GetScreenLockLibrary(); 79 ScreenLockLibrary* GetScreenLockLibrary();
80 UpdateLibrary* GetUpdateLibrary(); 80 UpdateLibrary* GetUpdateLibrary();
81 81
82 // Getter for Test API that gives access to internal members of this class. 82 // Getter for Test API that gives access to internal members of this class.
83 TestApi* GetTestApi(); 83 TestApi* GetTestApi();
84 84
85 // TODO(stevenjb): Deprecate this. Libraries should fall back to stub
86 // implementations if libcros_loaded() is false, and/or use libcros_loaded()
87 // to protect calls to libcros. http://crosbug.com/19886
88 bool EnsureLoaded() { return use_stub_impl_ || libcros_loaded_; }
89
90 bool libcros_loaded() { return libcros_loaded_; } 85 bool libcros_loaded() { return libcros_loaded_; }
91 86
92 // Returns an unlocalized string describing the last load error (if any). 87 // Returns an unlocalized string describing the last load error (if any).
93 const std::string& load_error_string() { 88 const std::string& load_error_string() {
94 return load_error_string_; 89 return load_error_string_;
95 } 90 }
96 91
97 private: 92 private:
98 friend struct base::DefaultLazyInstanceTraits<chromeos::CrosLibrary>; 93 friend struct base::DefaultLazyInstanceTraits<chromeos::CrosLibrary>;
99 friend class CrosLibrary::TestApi; 94 friend class CrosLibrary::TestApi;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 chromeos::CrosLibrary::Shutdown(); 170 chromeos::CrosLibrary::Shutdown();
176 } 171 }
177 172
178 private: 173 private:
179 DISALLOW_COPY_AND_ASSIGN(ScopedStubCrosEnabler); 174 DISALLOW_COPY_AND_ASSIGN(ScopedStubCrosEnabler);
180 }; 175 };
181 176
182 } // namespace chromeos 177 } // namespace chromeos
183 178
184 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ 179 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698