Index: chrome/browser/chromeos/cros/cros_library.cc |
diff --git a/chrome/browser/chromeos/cros/cros_library.cc b/chrome/browser/chromeos/cros/cros_library.cc |
index e9b834d323b1dc51683faf0329d34e8d010e3791..a9e469d31b7d5518c335ea155d527301ce437e83 100644 |
--- a/chrome/browser/chromeos/cros/cros_library.cc |
+++ b/chrome/browser/chromeos/cros/cros_library.cc |
@@ -17,6 +17,7 @@ |
#include "chrome/browser/chromeos/cros/synaptics_library.h" |
#include "chrome/browser/chromeos/cros/syslogs_library.h" |
#include "chrome/browser/chromeos/cros/system_library.h" |
+#include "chrome/browser/chromeos/cros/update_library.h" |
namespace chromeos { |
@@ -33,6 +34,7 @@ CrosLibrary::CrosLibrary() : library_loader_(NULL), |
synaptics_lib_(NULL), |
syslogs_lib_(NULL), |
system_lib_(NULL), |
+ update_lib_(NULL), |
own_library_loader_(true), |
own_cryptohome_lib_(true), |
own_keyboard_lib_(true), |
@@ -46,6 +48,7 @@ CrosLibrary::CrosLibrary() : library_loader_(NULL), |
own_synaptics_lib_(true), |
own_syslogs_lib_(true), |
own_system_lib_(true), |
+ own_update_lib_(true), |
loaded_(false), |
load_error_(false), |
test_api_(NULL) { |
@@ -79,6 +82,8 @@ CrosLibrary::~CrosLibrary() { |
delete syslogs_lib_; |
if (own_system_lib_) |
delete system_lib_; |
+ if (own_update_lib_) |
+ delete update_lib_; |
delete test_api_; |
} |
@@ -159,6 +164,12 @@ SystemLibrary* CrosLibrary::GetSystemLibrary() { |
return system_lib_; |
} |
+UpdateLibrary* CrosLibrary::GetUpdateLibrary() { |
+ if (!update_lib_) |
+ update_lib_ = new UpdateLibraryImpl(); |
+ return update_lib_; |
+} |
+ |
bool CrosLibrary::EnsureLoaded() { |
if (!loaded_ && !load_error_) { |
if (!library_loader_) |
@@ -281,4 +292,12 @@ void CrosLibrary::TestApi::SetSystemLibrary(SystemLibrary* library, |
library_->system_lib_ = library; |
} |
+void CrosLibrary::TestApi::SetUpdateLibrary(UpdateLibrary* library, |
+ bool own) { |
+ if (library_->update_lib_) |
+ delete library_->update_lib_; |
+ library_->own_update_lib_ = own; |
+ library_->update_lib_ = library; |
+} |
+ |
} // namespace chromeos |