| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/chromeos/cros/cros_library.h" | 5 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/cros/cert_library.h" | 7 #include "chrome/browser/chromeos/cros/cert_library.h" |
| 8 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | |
| 9 #include "chrome/browser/chromeos/cros/network_library.h" | 8 #include "chrome/browser/chromeos/cros/network_library.h" |
| 10 | 9 |
| 11 #define DEFINE_GET_LIBRARY_METHOD(class_prefix, var_prefix) \ | 10 #define DEFINE_GET_LIBRARY_METHOD(class_prefix, var_prefix) \ |
| 12 class_prefix##Library* CrosLibrary::Get##class_prefix##Library() { \ | 11 class_prefix##Library* CrosLibrary::Get##class_prefix##Library() { \ |
| 13 return var_prefix##_lib_.GetDefaultImpl(use_stub_impl_); \ | 12 return var_prefix##_lib_.GetDefaultImpl(use_stub_impl_); \ |
| 14 } | 13 } |
| 15 | 14 |
| 16 #define DEFINE_SET_LIBRARY_METHOD(class_prefix, var_prefix) \ | 15 #define DEFINE_SET_LIBRARY_METHOD(class_prefix, var_prefix) \ |
| 17 void CrosLibrary::TestApi::Set##class_prefix##Library( \ | 16 void CrosLibrary::TestApi::Set##class_prefix##Library( \ |
| 18 class_prefix##Library* library, bool own) { \ | 17 class_prefix##Library* library, bool own) { \ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 46 g_cros_library = NULL; | 45 g_cros_library = NULL; |
| 47 VLOG(1) << " CrosLibrary Shutdown completed."; | 46 VLOG(1) << " CrosLibrary Shutdown completed."; |
| 48 } | 47 } |
| 49 | 48 |
| 50 // static | 49 // static |
| 51 CrosLibrary* CrosLibrary::Get() { | 50 CrosLibrary* CrosLibrary::Get() { |
| 52 return g_cros_library; | 51 return g_cros_library; |
| 53 } | 52 } |
| 54 | 53 |
| 55 DEFINE_GET_LIBRARY_METHOD(Cert, cert); | 54 DEFINE_GET_LIBRARY_METHOD(Cert, cert); |
| 56 DEFINE_GET_LIBRARY_METHOD(Cryptohome, crypto); | |
| 57 DEFINE_GET_LIBRARY_METHOD(Network, network); | 55 DEFINE_GET_LIBRARY_METHOD(Network, network); |
| 58 | 56 |
| 59 CrosLibrary::TestApi* CrosLibrary::GetTestApi() { | 57 CrosLibrary::TestApi* CrosLibrary::GetTestApi() { |
| 60 if (!test_api_.get()) | 58 if (!test_api_.get()) |
| 61 test_api_.reset(new TestApi(this)); | 59 test_api_.reset(new TestApi(this)); |
| 62 return test_api_.get(); | 60 return test_api_.get(); |
| 63 } | 61 } |
| 64 | 62 |
| 65 DEFINE_SET_LIBRARY_METHOD(Cert, cert); | 63 DEFINE_SET_LIBRARY_METHOD(Cert, cert); |
| 66 DEFINE_SET_LIBRARY_METHOD(Cryptohome, crypto); | |
| 67 DEFINE_SET_LIBRARY_METHOD(Network, network); | 64 DEFINE_SET_LIBRARY_METHOD(Network, network); |
| 68 | 65 |
| 69 } // namespace chromeos | 66 } // namespace chromeos |
| OLD | NEW |