| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/singleton.h" | 13 #include "base/singleton.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 class BrightnessLibrary; |
| 17 class BurnLibrary; | 18 class BurnLibrary; |
| 18 class CryptohomeLibrary; | 19 class CryptohomeLibrary; |
| 19 class KeyboardLibrary; | 20 class KeyboardLibrary; |
| 20 class InputMethodLibrary; | 21 class InputMethodLibrary; |
| 21 class LibraryLoader; | 22 class LibraryLoader; |
| 22 class LoginLibrary; | 23 class LoginLibrary; |
| 23 class MountLibrary; | 24 class MountLibrary; |
| 24 class NetworkLibrary; | 25 class NetworkLibrary; |
| 25 class PowerLibrary; | 26 class PowerLibrary; |
| 26 class ScreenLockLibrary; | 27 class ScreenLockLibrary; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 43 // Use the stub implementations of the library. This is mainly for | 44 // Use the stub implementations of the library. This is mainly for |
| 44 // running the chromeos build of chrome on the desktop. | 45 // running the chromeos build of chrome on the desktop. |
| 45 void SetUseStubImpl(); | 46 void SetUseStubImpl(); |
| 46 // Reset the stub implementations of the library, called after | 47 // Reset the stub implementations of the library, called after |
| 47 // SetUseStubImp is called. | 48 // SetUseStubImp is called. |
| 48 void ResetUseStubImpl(); | 49 void ResetUseStubImpl(); |
| 49 // Passing true for own for these setters will cause them to be deleted | 50 // Passing true for own for these setters will cause them to be deleted |
| 50 // when the CrosLibrary is deleted (or other mocks are set). | 51 // when the CrosLibrary is deleted (or other mocks are set). |
| 51 // Setter for LibraryLoader. | 52 // Setter for LibraryLoader. |
| 52 void SetLibraryLoader(LibraryLoader* loader, bool own); | 53 void SetLibraryLoader(LibraryLoader* loader, bool own); |
| 54 // Setter for BrightnessLibrary. |
| 55 void SetBrightnessLibrary(BrightnessLibrary* library, bool own); |
| 53 // Setter for BurnLibrary. | 56 // Setter for BurnLibrary. |
| 54 void SetBurnLibrary(BurnLibrary* library, bool own); | 57 void SetBurnLibrary(BurnLibrary* library, bool own); |
| 55 // Setter for CryptohomeLibrary. | 58 // Setter for CryptohomeLibrary. |
| 56 void SetCryptohomeLibrary(CryptohomeLibrary* library, bool own); | 59 void SetCryptohomeLibrary(CryptohomeLibrary* library, bool own); |
| 57 // Setter for KeyboardLibrary | 60 // Setter for KeyboardLibrary |
| 58 void SetKeyboardLibrary(KeyboardLibrary* library, bool own); | 61 void SetKeyboardLibrary(KeyboardLibrary* library, bool own); |
| 59 // Setter for InputMethodLibrary | 62 // Setter for InputMethodLibrary |
| 60 void SetInputMethodLibrary(InputMethodLibrary* library, bool own); | 63 void SetInputMethodLibrary(InputMethodLibrary* library, bool own); |
| 61 // Setter for LoginLibrary. | 64 // Setter for LoginLibrary. |
| 62 void SetLoginLibrary(LoginLibrary* library, bool own); | 65 void SetLoginLibrary(LoginLibrary* library, bool own); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 81 | 84 |
| 82 private: | 85 private: |
| 83 friend class CrosLibrary; | 86 friend class CrosLibrary; |
| 84 explicit TestApi(CrosLibrary* library) : library_(library) {} | 87 explicit TestApi(CrosLibrary* library) : library_(library) {} |
| 85 CrosLibrary* library_; | 88 CrosLibrary* library_; |
| 86 }; | 89 }; |
| 87 | 90 |
| 88 // This gets the CrosLibrary. | 91 // This gets the CrosLibrary. |
| 89 static CrosLibrary* Get(); | 92 static CrosLibrary* Get(); |
| 90 | 93 |
| 94 // Getter for BrightnessLibrary. |
| 95 BrightnessLibrary* GetBrightnessLibrary(); |
| 96 |
| 91 // Getter for BurnLibrary. | 97 // Getter for BurnLibrary. |
| 92 BurnLibrary* GetBurnLibrary(); | 98 BurnLibrary* GetBurnLibrary(); |
| 93 | 99 |
| 94 // Getter for CryptohomeLibrary. | 100 // Getter for CryptohomeLibrary. |
| 95 CryptohomeLibrary* GetCryptohomeLibrary(); | 101 CryptohomeLibrary* GetCryptohomeLibrary(); |
| 96 | 102 |
| 97 // Getter for KeyboardLibrary | 103 // Getter for KeyboardLibrary |
| 98 KeyboardLibrary* GetKeyboardLibrary(); | 104 KeyboardLibrary* GetKeyboardLibrary(); |
| 99 | 105 |
| 100 // Getter for InputMethodLibrary | 106 // Getter for InputMethodLibrary |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 library_ = library; | 189 library_ = library; |
| 184 own_ = own; | 190 own_ = own; |
| 185 } | 191 } |
| 186 } | 192 } |
| 187 | 193 |
| 188 private: | 194 private: |
| 189 L* library_; | 195 L* library_; |
| 190 bool own_; | 196 bool own_; |
| 191 }; | 197 }; |
| 192 | 198 |
| 199 Library<BrightnessLibrary> brightness_lib_; |
| 193 Library<BurnLibrary> burn_lib_; | 200 Library<BurnLibrary> burn_lib_; |
| 194 Library<CryptohomeLibrary> crypto_lib_; | 201 Library<CryptohomeLibrary> crypto_lib_; |
| 195 Library<KeyboardLibrary> keyboard_lib_; | 202 Library<KeyboardLibrary> keyboard_lib_; |
| 196 Library<InputMethodLibrary> input_method_lib_; | 203 Library<InputMethodLibrary> input_method_lib_; |
| 197 Library<LoginLibrary> login_lib_; | 204 Library<LoginLibrary> login_lib_; |
| 198 Library<MountLibrary> mount_lib_; | 205 Library<MountLibrary> mount_lib_; |
| 199 Library<NetworkLibrary> network_lib_; | 206 Library<NetworkLibrary> network_lib_; |
| 200 Library<PowerLibrary> power_lib_; | 207 Library<PowerLibrary> power_lib_; |
| 201 Library<ScreenLockLibrary> screen_lock_lib_; | 208 Library<ScreenLockLibrary> screen_lock_lib_; |
| 202 Library<SpeechSynthesisLibrary> speech_synthesis_lib_; | 209 Library<SpeechSynthesisLibrary> speech_synthesis_lib_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 230 chromeos::CrosLibrary::Get()->GetTestApi()->ResetUseStubImpl(); | 237 chromeos::CrosLibrary::Get()->GetTestApi()->ResetUseStubImpl(); |
| 231 } | 238 } |
| 232 | 239 |
| 233 private: | 240 private: |
| 234 DISALLOW_COPY_AND_ASSIGN(ScopedStubCrosEnabler); | 241 DISALLOW_COPY_AND_ASSIGN(ScopedStubCrosEnabler); |
| 235 }; | 242 }; |
| 236 | 243 |
| 237 } // namespace chromeos | 244 } // namespace chromeos |
| 238 | 245 |
| 239 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ | 246 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_LIBRARY_H_ |
| OLD | NEW |