summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 23:44:24 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 23:44:24 +0000
commit62c7ef3ebecbdf274c85b0bbd64be3187e39b32f (patch)
treed17ca2a8f18aab2b3f28974561ee8bd039b0745c /chrome/browser/dom_ui
parent9e9e55c35954a06b68d5e62a27fa1ea60675d6f2 (diff)
downloadchromium_src-62c7ef3ebecbdf274c85b0bbd64be3187e39b32f.zip
chromium_src-62c7ef3ebecbdf274c85b0bbd64be3187e39b32f.tar.gz
chromium_src-62c7ef3ebecbdf274c85b0bbd64be3187e39b32f.tar.bz2
Mocks for all libcros elements. Added library registry object that provides access to all *Libray classes that used to be singletons. This registry adds an indirection layer that will let is replace the actual objects with mocks during test runs.
BUG=chromium-os:2026 TEST=none Review URL: http://codereview.chromium.org/1142005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/filebrowse_ui.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc
index 100124e..c1e69c7 100644
--- a/chrome/browser/dom_ui/filebrowse_ui.cc
+++ b/chrome/browser/dom_ui/filebrowse_ui.cc
@@ -43,6 +43,7 @@
#include "grit/locale_settings.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/mount_library.h"
#endif
@@ -307,14 +308,16 @@ FilebrowseHandler::FilebrowseHandler()
download_manager_(NULL) {
lister_ = NULL;
#if defined(OS_CHROMEOS)
- chromeos::MountLibrary* lib = chromeos::MountLibrary::Get();
+ chromeos::MountLibrary* lib =
+ chromeos::CrosLibrary::Get()->GetMountLibrary();
lib->AddObserver(this);
#endif
}
FilebrowseHandler::~FilebrowseHandler() {
#if defined(OS_CHROMEOS)
- chromeos::MountLibrary* lib = chromeos::MountLibrary::Get();
+ chromeos::MountLibrary* lib =
+ chromeos::CrosLibrary::Get()->GetMountLibrary();
lib->RemoveObserver(this);
#endif
if (lister_.get()) {
@@ -437,7 +440,8 @@ void FilebrowseHandler::HandleGetRoots(const Value* value) {
DictionaryValue info_value;
// TODO(dhg): add other entries, make this more general
#if defined(OS_CHROMEOS)
- chromeos::MountLibrary* lib = chromeos::MountLibrary::Get();
+ chromeos::MountLibrary* lib =
+ chromeos::CrosLibrary::Get()->GetMountLibrary();
const chromeos::MountLibrary::DiskVector& disks = lib->disks();
for (size_t i = 0; i < disks.size(); ++i) {