diff --git a/AUTHORS b/AUTHORS index 35d84a9163bc5..6159f425351a2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -314,6 +314,7 @@ Taylor Price Ted Vessenes Teodora Novkovic Thiago Farina +Thiago Marcos P. Santos Tiago Vignatti Tim Ansell Timo Reimann diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 51fae5505eccb..5504dfa5668b6 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -23,6 +23,7 @@ include_rules = [ "+components/sessions", "+components/signin", "+components/startup_metric_utils", + "+components/storage_monitor", "+components/translate/content/browser", "+components/translate/core/browser", "+components/translate/core/common", diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index faf5d6fbf3c60..3122e9762178e 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h @@ -38,7 +38,6 @@ class Profile; class ProfileManager; class SafeBrowsingService; class StatusTray; -class StorageMonitor; class WatchDogThread; #if defined(ENABLE_WEBRTC) class WebRtcLogUploader; @@ -216,8 +215,6 @@ class BrowserProcess { virtual MediaFileSystemRegistry* media_file_system_registry() = 0; - virtual StorageMonitor* storage_monitor() = 0; - virtual bool created_local_state() const = 0; #if defined(ENABLE_WEBRTC) diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 7fec85ccae555..681515ce6bea1 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -64,7 +64,6 @@ #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/status_icons/status_tray.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_finder.h" @@ -112,6 +111,7 @@ #if !defined(OS_ANDROID) && !defined(OS_IOS) #include "chrome/browser/media_galleries/media_file_system_registry.h" +#include "components/storage_monitor/storage_monitor.h" #endif #if defined(ENABLE_PLUGIN_INSTALLATION) @@ -263,11 +263,11 @@ void BrowserProcessImpl::StartTearDown() { #if !defined(OS_ANDROID) && !defined(OS_IOS) media_file_system_registry_.reset(); - // Delete |storage_monitor_| now. Otherwise the FILE thread would be gone - // when we try to release it in the dtor and Valgrind would report a - // leak on almost every single browser_test. + // Remove the global instance of the Storage Monitor now. Otherwise the + // FILE thread would be gone when we try to release it in the dtor and + // Valgrind would report a leak on almost every single browser_test. // TODO(gbillock): Make this unnecessary. - storage_monitor_.reset(); + StorageMonitor::Destroy(); #endif message_center::MessageCenter::Shutdown(); @@ -644,21 +644,6 @@ BookmarkPromptController* BrowserProcessImpl::bookmark_prompt_controller() { #endif } -StorageMonitor* BrowserProcessImpl::storage_monitor() { -#if defined(OS_ANDROID) || defined(OS_IOS) - return NULL; -#else - return storage_monitor_.get(); -#endif -} - -void BrowserProcessImpl::set_storage_monitor_for_test( - scoped_ptr monitor) { -#if !defined(OS_ANDROID) && !defined(OS_IOS) - storage_monitor_ = monitor.Pass(); -#endif -} - MediaFileSystemRegistry* BrowserProcessImpl::media_file_system_registry() { #if defined(OS_ANDROID) || defined(OS_IOS) return NULL; @@ -970,7 +955,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { #endif #if !defined(OS_ANDROID) && !defined(OS_IOS) - storage_monitor_.reset(StorageMonitor::Create()); + StorageMonitor::Create(); #endif platform_part_->PreMainMessageLoopRun(); diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 5e83d00a97e8b..a8ced520cdbcc 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -128,8 +128,6 @@ class BrowserProcessImpl : public BrowserProcess, virtual component_updater::PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; - virtual StorageMonitor* storage_monitor() OVERRIDE; - void set_storage_monitor_for_test(scoped_ptr monitor); virtual MediaFileSystemRegistry* media_file_system_registry() OVERRIDE; virtual bool created_local_state() const OVERRIDE; #if defined(ENABLE_WEBRTC) @@ -203,8 +201,6 @@ class BrowserProcessImpl : public BrowserProcess, #endif #if !defined(OS_ANDROID) && !defined(OS_IOS) - scoped_ptr storage_monitor_; - scoped_ptr media_file_system_registry_; #endif diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc index 9ae5ec058f9b4..52f8641c960f7 100644 --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc @@ -17,7 +17,6 @@ #include "components/breakpad/app/breakpad_linux.h" #if !defined(OS_CHROMEOS) -#include "chrome/browser/storage_monitor/storage_monitor_linux.h" #include "chrome/browser/sxs_linux.h" #include "content/public/browser/browser_thread.h" #endif diff --git a/chrome/browser/chromeos/camera_detector.cc b/chrome/browser/chromeos/camera_detector.cc index b5493eded5529..fadc7ac470b21 100644 --- a/chrome/browser/chromeos/camera_detector.cc +++ b/chrome/browser/chromeos/camera_detector.cc @@ -12,7 +12,7 @@ #include "base/strings/string_util.h" #include "base/task_runner_util.h" #include "base/threading/sequenced_worker_pool.h" -#include "chrome/browser/storage_monitor/udev_util_linux.h" +#include "components/storage_monitor/udev_util_linux.h" #include "content/public/browser/browser_thread.h" namespace chromeos { diff --git a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h index c13555f4f70e2..2fb6a39967767 100644 --- a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h +++ b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h @@ -5,7 +5,6 @@ #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_REMOVABLE_STORAGE_PROVIDER_H_ #include "base/callback.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/common/extensions/api/image_writer_private.h" #include "chrome/common/ref_counted_util.h" diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc index ac92b996162da..fed85fb911399 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc @@ -30,11 +30,11 @@ #include "chrome/browser/media_galleries/media_scan_manager.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/browser/ui/chrome_select_file_policy.h" #include "chrome/common/extensions/api/media_galleries.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" #include "chrome/common/pref_names.h" +#include "components/storage_monitor/storage_info.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.h b/chrome/browser/extensions/api/media_galleries/media_galleries_api.h index 6a9a4b2d62144..eff3e0c6a5774 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.h +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.h @@ -17,8 +17,8 @@ #include "chrome/browser/extensions/chrome_extension_function.h" #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_scan_manager_observer.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" #include "chrome/common/extensions/api/media_galleries.h" +#include "components/storage_monitor/media_storage_util.h" namespace MediaGalleries = extensions::api::media_galleries; diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc index 2fec80623fd48..bfbdb81d02d6e 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc @@ -18,9 +18,9 @@ #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/media_galleries/media_galleries_test_util.h" #include "chrome/browser/media_galleries/media_scan_manager.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/common/chrome_paths.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/test/test_utils.h" #include "extensions/browser/extension_system.h" diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc index 18b92081ad497..5a6046892c6d5 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc @@ -20,7 +20,6 @@ #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/common/extensions/api/media_galleries_private/media_galleries_handler.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_view_host.h" diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc index 22b4bc0b5a89d..bfb1ed3c5eda4 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc @@ -8,12 +8,12 @@ #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_test_message_listener.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test_utils.h" diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc index 2bb83c141ca2b..8b22d469a0926 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc @@ -12,8 +12,8 @@ #include "base/values.h" #include "chrome/browser/extensions/event_names.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/common/extensions/api/media_galleries_private.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/event_router.h" #include "extensions/browser/extension_system.h" diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h index 19154000e35fa..ac8b40316fb4b 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h @@ -17,7 +17,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" +#include "components/storage_monitor/removable_storage_observer.h" class Profile; diff --git a/chrome/browser/extensions/api/system_info/system_info_api.cc b/chrome/browser/extensions/api/system_info/system_info_api.cc index c6fc3651e26a5..90bde75c2bc3c 100644 --- a/chrome/browser/extensions/api/system_info/system_info_api.cc +++ b/chrome/browser/extensions/api/system_info/system_info_api.cc @@ -15,11 +15,11 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" #include "chrome/browser/extensions/event_router_forwarder.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/common/extensions/api/system_display.h" #include "chrome/common/extensions/api/system_storage.h" +#include "components/storage_monitor/removable_storage_observer.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_system.h" #include "ui/gfx/display_observer.h" diff --git a/chrome/browser/extensions/api/system_storage/storage_api_test_util.h b/chrome/browser/extensions/api/system_storage/storage_api_test_util.h index 6bdfc0e2881e6..dd966169af355 100644 --- a/chrome/browser/extensions/api/system_storage/storage_api_test_util.h +++ b/chrome/browser/extensions/api/system_storage/storage_api_test_util.h @@ -8,7 +8,7 @@ #include #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" namespace extensions { namespace test { diff --git a/chrome/browser/extensions/api/system_storage/storage_info_provider.cc b/chrome/browser/extensions/api/system_storage/storage_info_provider.cc index e045e806d2efb..62bcc0ad42e28 100644 --- a/chrome/browser/extensions/api/system_storage/storage_info_provider.cc +++ b/chrome/browser/extensions/api/system_storage/storage_info_provider.cc @@ -8,7 +8,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/sys_info.h" #include "base/threading/sequenced_worker_pool.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" namespace extensions { diff --git a/chrome/browser/extensions/api/system_storage/storage_info_provider.h b/chrome/browser/extensions/api/system_storage/storage_info_provider.h index e94246a12dda5..6074d204806df 100644 --- a/chrome/browser/extensions/api/system_storage/storage_info_provider.h +++ b/chrome/browser/extensions/api/system_storage/storage_info_provider.h @@ -12,11 +12,8 @@ #include "base/observer_list_threadsafe.h" #include "base/timer/timer.h" #include "chrome/browser/extensions/api/system_info/system_info_provider.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/common/extensions/api/system_storage.h" -#include "content/public/browser/notification_observer.h" -#include "content/public/browser/notification_registrar.h" +#include "components/storage_monitor/storage_info.h" namespace extensions { diff --git a/chrome/browser/extensions/api/system_storage/system_storage_api.h b/chrome/browser/extensions/api/system_storage/system_storage_api.h index 3bc3d9ae8b8c4..cd6462e41d59d 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_api.h +++ b/chrome/browser/extensions/api/system_storage/system_storage_api.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_ #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "extensions/browser/extension_function.h" namespace extensions { diff --git a/chrome/browser/extensions/api/system_storage/system_storage_apitest.cc b/chrome/browser/extensions/api/system_storage/system_storage_apitest.cc index 960c38090d395..c9ca13f00c92d 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_apitest.cc +++ b/chrome/browser/extensions/api/system_storage/system_storage_apitest.cc @@ -10,9 +10,9 @@ #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_test_message_listener.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" namespace { diff --git a/chrome/browser/extensions/api/system_storage/system_storage_eject_apitest.cc b/chrome/browser/extensions/api/system_storage/system_storage_eject_apitest.cc index 654c073998e3e..1860d7a6e4938 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_eject_apitest.cc +++ b/chrome/browser/extensions/api/system_storage/system_storage_eject_apitest.cc @@ -11,9 +11,9 @@ #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_test_message_listener.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/render_view_host.h" #include "content/public/test/test_utils.h" #include "extensions/browser/extension_system.h" diff --git a/chrome/browser/media_galleries/fileapi/iapps_finder_impl.h b/chrome/browser/media_galleries/fileapi/iapps_finder_impl.h index defc3885f5cca..e2bf80dfbd83c 100644 --- a/chrome/browser/media_galleries/fileapi/iapps_finder_impl.h +++ b/chrome/browser/media_galleries/fileapi/iapps_finder_impl.h @@ -10,7 +10,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "chrome/browser/media_galleries/fileapi/iapps_finder.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" #if defined(OS_MACOSX) diff --git a/chrome/browser/media_galleries/fileapi/iapps_finder_impl_mac.mm b/chrome/browser/media_galleries/fileapi/iapps_finder_impl_mac.mm index f9fda68757889..3b2c672777a90 100644 --- a/chrome/browser/media_galleries/fileapi/iapps_finder_impl_mac.mm +++ b/chrome/browser/media_galleries/fileapi/iapps_finder_impl_mac.mm @@ -11,8 +11,8 @@ #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/time/time.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "components/policy/core/common/preferences_mac.h" +#include "components/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" using base::mac::CFCast; diff --git a/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win.cc b/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win.cc index 1f235469ec075..55259c0a63400 100644 --- a/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win.cc +++ b/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win.cc @@ -13,8 +13,8 @@ #include "base/path_service.h" #include "chrome/browser/media_galleries/fileapi/iapps_finder.h" #include "chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/common/chrome_paths.h" +#include "components/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" namespace iapps { diff --git a/chrome/browser/media_galleries/fileapi/picasa_finder.cc b/chrome/browser/media_galleries/fileapi/picasa_finder.cc index 68f2c794ec7d3..9eed5b5ed4334 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_finder.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_finder.cc @@ -13,8 +13,8 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/strings/string16.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/common/media_galleries/picasa_types.h" +#include "components/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" #if defined(OS_WIN) diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc b/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc index 8dd1ce154411f..2affeee68c8bc 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc @@ -11,7 +11,7 @@ #include "chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h" #include "chrome/browser/media_galleries/linux/mtp_read_file_worker.h" #include "chrome/browser/media_galleries/linux/snapshot_file_details.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" #include "net/base/io_buffer.h" diff --git a/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc b/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc index e27113cd4c272..9aa5c9c8b59ed 100644 --- a/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc +++ b/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc @@ -9,7 +9,7 @@ #include "base/files/file_path.h" #include "base/numerics/safe_conversions.h" #include "chrome/browser/media_galleries/linux/snapshot_file_details.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" #include "third_party/cros_system_api/dbus/service_constants.h" diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm index a17c2629ea290..92b2b3018288a 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm @@ -8,8 +8,8 @@ #include "base/mac/scoped_nsobject.h" #include "base/threading/sequenced_worker_pool.h" -#include "chrome/browser/storage_monitor/image_capture_device.h" -#include "chrome/browser/storage_monitor/image_capture_device_manager.h" +#include "components/storage_monitor/image_capture_device.h" +#include "components/storage_monitor/image_capture_device_manager.h" #include "content/public/browser/browser_thread.h" #include "webkit/browser/fileapi/async_file_util.h" diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm index 89b55f95123d9..1df90609097e7 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm @@ -18,8 +18,8 @@ #include "base/test/sequenced_worker_pool_owner.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h" -#include "chrome/browser/storage_monitor/image_capture_device_manager.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/image_capture_device_manager.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -190,7 +190,7 @@ virtual void TearDown() OVERRIDE { delegate_->CancelPendingTasksAndDeleteDelegate(); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); io_thread_->Stop(); } diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc index 9b1ab4525514e..6f33eff9411ce 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.cc +++ b/chrome/browser/media_galleries/media_file_system_registry.cc @@ -21,11 +21,11 @@ #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" #include "chrome/browser/media_galleries/media_scan_manager.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/pref_names.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/render_process_host.h" diff --git a/chrome/browser/media_galleries/media_file_system_registry.h b/chrome/browser/media_galleries/media_file_system_registry.h index 6767fa739329b..d9aced2312eaf 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.h +++ b/chrome/browser/media_galleries/media_file_system_registry.h @@ -18,7 +18,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" +#include "components/storage_monitor/removable_storage_observer.h" class ExtensionGalleriesHost; class MediaFileSystemContext; diff --git a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc index dc65189a018d9..c70b3183be764 100644 --- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc +++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc @@ -28,14 +28,14 @@ #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" #include "chrome/browser/media_galleries/media_galleries_test_util.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host_factory.h" #include "content/public/browser/render_view_host.h" @@ -787,7 +787,7 @@ void MediaFileSystemRegistryTest::TearDown() { MediaFileSystemRegistry* registry = g_browser_process->media_file_system_registry(); EXPECT_EQ(0U, GetExtensionGalleriesHostCount(registry)); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); #if defined(OS_CHROMEOS) test_user_manager_.reset(); #endif diff --git a/chrome/browser/media_galleries/media_folder_finder.cc b/chrome/browser/media_galleries/media_folder_finder.cc index 57057fafb4d1e..f30c373d3a0d0 100644 --- a/chrome/browser/media_galleries/media_folder_finder.cc +++ b/chrome/browser/media_galleries/media_folder_finder.cc @@ -15,7 +15,7 @@ #include "base/task_runner_util.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" #if defined(OS_CHROMEOS) diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc index 278c0b395dad0..bcc5dfb59bd28 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc @@ -14,10 +14,10 @@ #include "chrome/browser/media_galleries/media_galleries_histograms.h" #include "chrome/browser/media_galleries/media_gallery_context_menu.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/browser/ui/chrome_select_file_policy.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "extensions/browser/extension_prefs.h" diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.h b/chrome/browser/media_galleries/media_galleries_dialog_controller.h index 6f97a70299e4e..6c67b1b5c72bd 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller.h +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.h @@ -12,7 +12,7 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" +#include "components/storage_monitor/removable_storage_observer.h" #include "ui/gfx/native_widget_types.h" #include "ui/shell_dialogs/select_file_dialog.h" diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc index 4a22d2730f177..c46a9fb2f917e 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc @@ -13,10 +13,10 @@ #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/media_galleries/media_galleries_test_util.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" #include "chrome/test/base/testing_profile.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -103,7 +103,7 @@ class MediaGalleriesDialogControllerTest : public ::testing::Test { } virtual void TearDown() OVERRIDE { - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } void StartDialog() { diff --git a/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc b/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc index 4cfc8884c804f..7e1b571fee274 100644 --- a/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc @@ -8,8 +8,8 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/media_galleries/media_galleries_test_util.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "chrome/test/base/testing_profile.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread.h" #include "extensions/browser/extension_prefs.h" @@ -52,7 +52,7 @@ class MediaGalleriesPermissionsTest : public extensions::ExtensionPrefsTest { prefs_.pref_service()->CommitPendingWrite(); message_loop_.RunUntilIdle(); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); testing::Test::TearDown(); } diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc index 3f16c98215de4..013cad74784c2 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences.cc @@ -23,11 +23,11 @@ #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_galleries_histograms.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" #include "chrome/common/pref_names.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/storage_monitor.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_system.h" diff --git a/chrome/browser/media_galleries/media_galleries_preferences.h b/chrome/browser/media_galleries/media_galleries_preferences.h index d2ae99b47b195..96d2bda95ccd0 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.h +++ b/chrome/browser/media_galleries/media_galleries_preferences.h @@ -16,8 +16,8 @@ #include "base/observer_list.h" #include "base/strings/string16.h" #include "base/time/time.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" #include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/storage_monitor/removable_storage_observer.h" class Profile; diff --git a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc index 2cc4780eb02f2..886f91677fee5 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc @@ -15,11 +15,11 @@ #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_galleries_test_util.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" #include "chrome/test/base/testing_profile.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/test/test_browser_thread_bundle.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" @@ -151,7 +151,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { virtual void TearDown() OVERRIDE { Verify(); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } void Verify() { @@ -1222,5 +1222,5 @@ TEST(MediaGalleriesPrefInfoTest, NameGeneration) { EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("unique")).AsUTF8Unsafe(), base::UTF16ToUTF8(info.GetGalleryTooltip())); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } diff --git a/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.cc b/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.cc index 6ba06648fb95e..0bad540aeb224 100644 --- a/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.cc +++ b/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.cc @@ -17,9 +17,9 @@ #include "chrome/browser/media_galleries/media_gallery_context_menu.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/web_contents.h" #include "extensions/common/extension.h" #include "extensions/common/permissions/permissions_data.h" diff --git a/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h b/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h index adf905a463791..96d87b694931b 100644 --- a/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h +++ b/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h @@ -13,7 +13,7 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" +#include "components/storage_monitor/removable_storage_observer.h" namespace content { class WebContents; diff --git a/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller_unittest.cc b/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller_unittest.cc index 3a2e666682d55..2a7808ad418ea 100644 --- a/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller_unittest.cc @@ -15,9 +15,9 @@ #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h" #include "chrome/browser/media_galleries/media_galleries_test_util.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" #include "chrome/test/base/testing_profile.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/test/test_browser_thread_bundle.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" @@ -102,7 +102,7 @@ class MediaGalleriesScanResultDialogControllerTest : public testing::Test { } virtual void TearDown() OVERRIDE { - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } void StartDialog() { diff --git a/chrome/browser/media_galleries/media_scan_manager_unittest.cc b/chrome/browser/media_galleries/media_scan_manager_unittest.cc index 6d23369002af5..92c74805c68ca 100644 --- a/chrome/browser/media_galleries/media_scan_manager_unittest.cc +++ b/chrome/browser/media_galleries/media_scan_manager_unittest.cc @@ -16,9 +16,9 @@ #include "chrome/browser/media_galleries/media_galleries_test_util.h" #include "chrome/browser/media_galleries/media_scan_manager.h" #include "chrome/browser/media_galleries/media_scan_manager_observer.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "chrome/common/extensions/permissions/media_galleries_permission.h" #include "chrome/test/base/testing_profile.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/test/test_browser_thread_bundle.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" @@ -139,7 +139,7 @@ class MediaScanManagerTest : public MediaScanManagerObserver, virtual void TearDown() OVERRIDE { media_scan_manager_->RemoveObserver(profile_.get()); media_scan_manager_.reset(); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } // Create a test folder in the test specific scoped temp dir and return the diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc index 24880a59b5365..56a121ccdbd43 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc @@ -27,7 +27,7 @@ #include "chrome/browser/media_galleries/win/mtp_device_operations_util.h" #include "chrome/browser/media_galleries/win/portable_device_map_service.h" #include "chrome/browser/media_galleries/win/snapshot_file_details.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "webkit/common/fileapi/file_system_util.h" diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc index 194a354de558c..6b7346c0527df 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc @@ -14,15 +14,15 @@ #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_galleries_test_util.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_portable_device_watcher_win.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor_win.h" -#include "chrome/browser/storage_monitor/test_volume_mount_watcher_win.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_portable_device_watcher_win.h" +#include "components/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor_win.h" +#include "components/storage_monitor/test_volume_mount_watcher_win.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/extension_system.h" @@ -70,7 +70,7 @@ class MTPDeviceDelegateImplWinTest : public ChromeRenderViewHostTestHarness { void MTPDeviceDelegateImplWinTest::SetUp() { ChromeRenderViewHostTestHarness::SetUp(); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); TestPortableDeviceWatcherWin* portable_device_watcher = new TestPortableDeviceWatcherWin; TestVolumeMountWatcherWin* mount_watcher = new TestVolumeMountWatcherWin; @@ -80,7 +80,7 @@ void MTPDeviceDelegateImplWinTest::SetUp() { TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); DCHECK(browser_process); monitor_ = monitor.get(); - browser_process->SetStorageMonitor(monitor.Pass()); + StorageMonitor::SetStorageMonitorForTesting(monitor.Pass()); base::RunLoop runloop; browser_process->media_file_system_registry()->GetPreferences(profile())-> @@ -102,7 +102,7 @@ void MTPDeviceDelegateImplWinTest::SetUp() { void MTPDeviceDelegateImplWinTest::TearDown() { // Windows storage monitor must be destroyed on the same thread // as construction. - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); ChromeRenderViewHostTestHarness::TearDown(); } diff --git a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc index 062773b2ff243..6384e81afb340 100644 --- a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc +++ b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc @@ -18,7 +18,6 @@ #include "base/time/time.h" #include "base/win/scoped_co_mem.h" #include "base/win/scoped_propvariant.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" #include "chrome/common/chrome_constants.h" namespace media_transfer_protocol { diff --git a/chrome/browser/storage_monitor/DEPS b/chrome/browser/storage_monitor/DEPS deleted file mode 100644 index 8ef6ff8e47d0d..0000000000000 --- a/chrome/browser/storage_monitor/DEPS +++ /dev/null @@ -1,4 +0,0 @@ -include_rules = [ - # Avoid circular dependencies - media_galleries builds upon storage_monitor. - "-chrome/browser/media_galleries", -] diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_unittest.mm b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_unittest.mm index 9015cccd45afe..76d8f626f2781 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_unittest.mm +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_unittest.mm @@ -5,8 +5,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" +#include "components/storage_monitor/storage_info.h" #include "extensions/common/extension.h" #include "extensions/common/test_util.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_scan_result_dialog_cocoa_unittest.mm b/chrome/browser/ui/cocoa/extensions/media_galleries_scan_result_dialog_cocoa_unittest.mm index ac857d3033b07..7c9b4424efb6a 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_scan_result_dialog_cocoa_unittest.mm +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_scan_result_dialog_cocoa_unittest.mm @@ -7,10 +7,10 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" #include "chrome/browser/ui/cocoa/extensions/media_galleries_scan_result_dialog_cocoa.h" +#include "components/storage_monitor/storage_info.h" #include "extensions/common/extension.h" #include "extensions/common/test_util.h" #include "testing/gtest_mac.h" diff --git a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk_unittest.cc b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk_unittest.cc index 7a644170b2c8b..deadd39a03a5d 100644 --- a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk_unittest.cc +++ b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk_unittest.cc @@ -5,8 +5,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h" +#include "components/storage_monitor/storage_info.h" #include "extensions/common/extension.h" #include "extensions/common/test_util.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc index a40637889b5a9..9df0fe6d1f660 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc @@ -5,8 +5,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h" -#include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" +#include "components/storage_monitor/storage_info.h" #include "extensions/common/extension.h" #include "extensions/common/test_util.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/ui/webui/options/media_galleries_handler.cc b/chrome/browser/ui/webui/options/media_galleries_handler.cc index 958e373af89ff..2bd431bc815b4 100644 --- a/chrome/browser/ui/webui/options/media_galleries_handler.cc +++ b/chrome/browser/ui/webui/options/media_galleries_handler.cc @@ -12,9 +12,9 @@ #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_galleries_histograms.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chrome/browser/ui/chrome_select_file_policy.h" #include "chrome/common/pref_names.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index e646d7569150e..1984e11ed897b 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2189,39 +2189,6 @@ 'browser/status_icons/status_icon_observer.h', 'browser/status_icons/status_tray.cc', 'browser/status_icons/status_tray.h', - 'browser/storage_monitor/image_capture_device.h', - 'browser/storage_monitor/image_capture_device.mm', - 'browser/storage_monitor/image_capture_device_manager.h', - 'browser/storage_monitor/image_capture_device_manager.mm', - 'browser/storage_monitor/media_storage_util.cc', - 'browser/storage_monitor/media_storage_util.h', - 'browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc', - 'browser/storage_monitor/media_transfer_protocol_device_observer_linux.h', - 'browser/storage_monitor/mtab_watcher_linux.cc', - 'browser/storage_monitor/mtab_watcher_linux.h', - 'browser/storage_monitor/portable_device_watcher_win.cc', - 'browser/storage_monitor/portable_device_watcher_win.h', - 'browser/storage_monitor/removable_device_constants.cc', - 'browser/storage_monitor/removable_device_constants.h', - 'browser/storage_monitor/removable_storage_observer.h', - 'browser/storage_monitor/storage_info.cc', - 'browser/storage_monitor/storage_info.h', - 'browser/storage_monitor/storage_monitor_chromeos.cc', - 'browser/storage_monitor/storage_monitor_chromeos.h', - 'browser/storage_monitor/storage_monitor_linux.cc', - 'browser/storage_monitor/storage_monitor_linux.h', - 'browser/storage_monitor/storage_monitor_mac.h', - 'browser/storage_monitor/storage_monitor_mac.mm', - 'browser/storage_monitor/storage_monitor_win.cc', - 'browser/storage_monitor/storage_monitor_win.h', - 'browser/storage_monitor/storage_monitor.cc', - 'browser/storage_monitor/storage_monitor.h', - 'browser/storage_monitor/transient_device_ids.cc', - 'browser/storage_monitor/transient_device_ids.h', - 'browser/storage_monitor/udev_util_linux.cc', - 'browser/storage_monitor/udev_util_linux.h', - 'browser/storage_monitor/volume_mount_watcher_win.cc', - 'browser/storage_monitor/volume_mount_watcher_win.h', 'browser/sxs_linux.cc', 'browser/sxs_linux.h', 'browser/sync/about_sync_util.cc', @@ -2664,6 +2631,7 @@ '../components/components.gyp:navigation_interception', '../components/components.gyp:precache_content', '../components/components.gyp:sessions', + '../components/components.gyp:storage_monitor', '../components/components.gyp:translate_content_browser', '../components/components.gyp:url_matcher', '../components/components.gyp:visitedlink_browser', @@ -3049,10 +3017,6 @@ 'browser/shell_integration_linux.h', 'browser/signin/signin_manager.cc', 'browser/speech/tts_linux.cc', - 'browser/storage_monitor/mtab_watcher_linux.cc', - 'browser/storage_monitor/mtab_watcher_linux.h', - 'browser/storage_monitor/storage_monitor_linux.cc', - 'browser/storage_monitor/storage_monitor_linux.h', 'browser/sxs_linux.cc', 'browser/sxs_linux.h', 'browser/task_manager/notification_resource_provider.cc', @@ -3252,6 +3216,7 @@ 'chrome_browser_jni_headers', ], 'dependencies!': [ + '../components/components.gyp:storage_monitor', '../components/components.gyp:web_modal', '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput', '../third_party/libusb/libusb.gyp:libusb', @@ -3345,8 +3310,6 @@ 'browser/ssl/ssl_add_cert_handler.cc', 'browser/ssl/ssl_client_auth_observer.cc', 'browser/status_icons/desktop_notification_balloon.cc', - 'browser/storage_monitor/media_storage_util.cc', - 'browser/storage_monitor/removable_device_constants.cc', 'browser/signin/mutable_profile_oauth2_token_service.cc', 'browser/signin/mutable_profile_oauth2_token_service.h', 'browser/signin/signin_ui_util.cc', diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 00ae6b5057ed2..0f247d91857ba 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -175,10 +175,6 @@ 'browser/signin/fake_signin_manager.h', 'browser/ssl/ssl_client_auth_requestor_mock.cc', 'browser/ssl/ssl_client_auth_requestor_mock.h', - 'browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc', - 'browser/storage_monitor/test_media_transfer_protocol_manager_linux.h', - 'browser/storage_monitor/test_storage_monitor.cc', - 'browser/storage_monitor/test_storage_monitor.h', 'browser/sync/profile_sync_service_mock.cc', 'browser/sync/profile_sync_service_mock.h', 'browser/ui/app_list/test/chrome_app_list_test_support.cc', @@ -306,6 +302,7 @@ '../content/content.gyp:content_worker', '../components/components.gyp:autofill_core_test_support', '../components/components.gyp:sessions_test_support', + '../components/components.gyp:storage_monitor_test_support', '../extensions/extensions.gyp:extensions_test_support', '../google_apis/google_apis.gyp:google_apis_test_support', '../ipc/ipc.gyp:test_support_ipc', @@ -385,6 +382,9 @@ ], }], ['OS=="android"', { + '!dependencies': [ + '../components/components.gyp:storage_monitor_test_support', + ], 'sources/': [ ['exclude', '^browser/media_galleries/'], ['exclude', '^browser/extensions/api/messaging/native_messaging_'], @@ -1274,23 +1274,6 @@ 'browser/status_icons/status_icon_menu_model_unittest.cc', 'browser/status_icons/status_icon_unittest.cc', 'browser/status_icons/status_tray_unittest.cc', - 'browser/storage_monitor/image_capture_device_manager_unittest.mm', - 'browser/storage_monitor/media_storage_util_unittest.cc', - 'browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc', - 'browser/storage_monitor/mock_removable_storage_observer.cc', - 'browser/storage_monitor/mock_removable_storage_observer.h', - 'browser/storage_monitor/storage_info_unittest.cc', - 'browser/storage_monitor/storage_monitor_chromeos_unittest.cc', - 'browser/storage_monitor/storage_monitor_linux_unittest.cc', - 'browser/storage_monitor/storage_monitor_mac_unittest.mm', - 'browser/storage_monitor/storage_monitor_win_unittest.cc', - 'browser/storage_monitor/storage_monitor_unittest.cc', - 'browser/storage_monitor/test_portable_device_watcher_win.cc', - 'browser/storage_monitor/test_portable_device_watcher_win.h', - 'browser/storage_monitor/test_storage_monitor_win.cc', - 'browser/storage_monitor/test_storage_monitor_win.h', - 'browser/storage_monitor/test_volume_mount_watcher_win.cc', - 'browser/storage_monitor/test_volume_mount_watcher_win.h', 'browser/sync/about_sync_util_unittest.cc', 'browser/sync/abstract_profile_sync_service_test.cc', 'browser/sync/abstract_profile_sync_service_test.h', @@ -2322,7 +2305,6 @@ 'browser/shell_integration_linux_unittest.cc', 'browser/signin/signin_manager_unittest.cc', 'browser/signin/signin_names_io_thread_unittest.cc', - 'browser/storage_monitor/storage_monitor_linux_unittest.cc', 'browser/ui/sync/one_click_signin_helper_unittest.cc', 'browser/ui/sync/one_click_signin_sync_starter_unittest.cc', 'browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc', @@ -2568,7 +2550,6 @@ 'browser/browser_commands_unittest.cc', 'browser/download/download_shelf_unittest.cc', 'browser/extensions/extension_message_bubble_controller_unittest.cc', - 'browser/storage_monitor/media_storage_util_unittest.cc', 'browser/policy/policy_path_parser_unittest.cc', 'browser/profiles/off_the_record_profile_impl_unittest.cc', 'browser/profiles/profile_list_desktop_unittest.cc', diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index a94414e08ba0c..dbfa4bc3859cc 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc @@ -67,7 +67,7 @@ #endif #if !defined(OS_ANDROID) && !defined(OS_IOS) -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #endif namespace { diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc index b27ad17ef2e30..2e56dd3c0cea1 100644 --- a/chrome/test/base/testing_browser_process.cc +++ b/chrome/test/base/testing_browser_process.cc @@ -28,8 +28,8 @@ #if !defined(OS_IOS) && !defined(OS_ANDROID) #include "chrome/browser/media_galleries/media_file_system_registry.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #endif #if defined(ENABLE_CONFIGURATION_POLICY) @@ -349,15 +349,6 @@ BookmarkPromptController* TestingBrowserProcess::bookmark_prompt_controller() { #endif } -StorageMonitor* TestingBrowserProcess::storage_monitor() { -#if defined(OS_IOS) || defined(OS_ANDROID) - NOTIMPLEMENTED(); - return NULL; -#else - return storage_monitor_.get(); -#endif -} - MediaFileSystemRegistry* TestingBrowserProcess::media_file_system_registry() { #if defined(OS_IOS) || defined(OS_ANDROID) NOTIMPLEMENTED(); @@ -436,13 +427,6 @@ void TestingBrowserProcess::SetSafeBrowsingService( #endif } -void TestingBrowserProcess::SetStorageMonitor( - scoped_ptr storage_monitor) { -#if !defined(OS_IOS) && !defined(OS_ANDROID) - storage_monitor_ = storage_monitor.Pass(); -#endif -} - /////////////////////////////////////////////////////////////////////////////// TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { diff --git a/chrome/test/base/testing_browser_process.h b/chrome/test/base/testing_browser_process.h index 717d87b7464d0..d497f5674dc21 100644 --- a/chrome/test/base/testing_browser_process.h +++ b/chrome/test/base/testing_browser_process.h @@ -113,7 +113,6 @@ class TestingBrowserProcess : public BrowserProcess { virtual component_updater::PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; - virtual StorageMonitor* storage_monitor() OVERRIDE; virtual MediaFileSystemRegistry* media_file_system_registry() OVERRIDE; virtual bool created_local_state() const OVERRIDE; @@ -130,7 +129,6 @@ class TestingBrowserProcess : public BrowserProcess { void SetSafeBrowsingService(SafeBrowsingService* sb_service); void SetBookmarkPromptController(BookmarkPromptController* controller); void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); - void SetStorageMonitor(scoped_ptr storage_monitor); private: // See CreateInstance() and DestoryInstance() above. @@ -164,7 +162,6 @@ class TestingBrowserProcess : public BrowserProcess { #endif // !defined(OS_IOS) #if !defined(OS_IOS) && !defined(OS_ANDROID) - scoped_ptr storage_monitor_; scoped_ptr media_file_system_registry_; #endif diff --git a/components/components.gyp b/components/components.gyp index 86c0c6a86ae5c..1b76d5331652b 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -37,6 +37,7 @@ 'navigation_interception.gypi', 'plugins.gypi', 'sessions.gypi', + 'storage_monitor.gypi', 'visitedlink.gypi', 'web_contents_delegate_android.gypi', 'web_modal.gypi', diff --git a/components/components_tests.gyp b/components/components_tests.gyp index 7bc6bf126a3c3..63bbf368052a4 100644 --- a/components/components_tests.gyp +++ b/components/components_tests.gyp @@ -48,6 +48,15 @@ 'precache/core/precache_url_table_unittest.cc', 'sessions/serialized_navigation_entry_unittest.cc', 'signin/core/webdata/token_service_table_unittest.cc', + 'storage_monitor/image_capture_device_manager_unittest.mm', + 'storage_monitor/media_storage_util_unittest.cc', + 'storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc', + 'storage_monitor/storage_info_unittest.cc', + 'storage_monitor/storage_monitor_chromeos_unittest.cc', + 'storage_monitor/storage_monitor_linux_unittest.cc', + 'storage_monitor/storage_monitor_mac_unittest.mm', + 'storage_monitor/storage_monitor_unittest.cc', + 'storage_monitor/storage_monitor_win_unittest.cc', 'sync_driver/model_association_manager_unittest.cc', 'sync_driver/system_encryptor_unittest.cc', 'test/run_all_unittests.cc', @@ -156,6 +165,10 @@ 'components.gyp:sessions', 'components.gyp:sessions_test_support', + # Dependencies of storage monitor + 'components.gyp:storage_monitor', + 'components.gyp:storage_monitor_test_support', + # Dependencies of url_matcher. 'components.gyp:url_matcher', @@ -171,6 +184,7 @@ }, { # 'OS == "ios"' 'sources/': [ ['exclude', '\\.cc$'], + ['exclude', '\\.mm$'], ['include', '^test/run_all_unittests\\.cc$'], # TODO(ios): Include files here as they are made to work, see # http://crbug.com/303011. @@ -215,6 +229,8 @@ 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AddressBook.framework', + '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/ImageCaptureCore.framework', ], }, 'sources!': [ @@ -223,9 +239,14 @@ }], ['OS == "android"', { 'sources!': [ + 'storage_monitor/media_storage_util_unittest.cc', + 'storage_monitor/storage_info_unittest.cc', + 'storage_monitor/storage_monitor_unittest.cc', 'web_modal/web_contents_modal_dialog_manager_unittest.cc', ], 'dependencies!': [ + 'components.gyp:storage_monitor', + 'components.gyp:storage_monitor_test_support', 'components.gyp:web_modal', 'components.gyp:web_modal_test_support', ], @@ -235,6 +256,20 @@ '../testing/android/native_test.gyp:native_test_native_code', ] }], + ['chromeos==1', { + 'sources!': [ + 'storage_monitor/storage_monitor_linux_unittest.cc', + ], + 'dependencies': [ + '../chromeos/chromeos.gyp:chromeos_test_support', + ], + }], + ['OS=="linux"', { + 'dependencies': [ + '../dbus/dbus.gyp:dbus', + '../device/media_transfer_protocol/media_transfer_protocol.gyp:device_media_transfer_protocol', + ], + }], ['OS=="win" and win_use_allocator_shim==1', { 'dependencies': [ '../base/allocator/allocator.gyp:allocator', diff --git a/components/storage_monitor.gypi b/components/storage_monitor.gypi new file mode 100644 index 0000000000000..5b62656e20167 --- /dev/null +++ b/components/storage_monitor.gypi @@ -0,0 +1,113 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'storage_monitor', + 'type': 'static_library', + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../base/base.gyp:base', + ], + 'sources': [ + 'storage_monitor/image_capture_device.h', + 'storage_monitor/image_capture_device.mm', + 'storage_monitor/image_capture_device_manager.h', + 'storage_monitor/image_capture_device_manager.mm', + 'storage_monitor/media_storage_util.cc', + 'storage_monitor/media_storage_util.h', + 'storage_monitor/media_transfer_protocol_device_observer_linux.cc', + 'storage_monitor/media_transfer_protocol_device_observer_linux.h', + 'storage_monitor/mtab_watcher_linux.cc', + 'storage_monitor/mtab_watcher_linux.h', + 'storage_monitor/portable_device_watcher_win.cc', + 'storage_monitor/portable_device_watcher_win.h', + 'storage_monitor/removable_device_constants.cc', + 'storage_monitor/removable_device_constants.h', + 'storage_monitor/removable_storage_observer.h', + 'storage_monitor/storage_info.cc', + 'storage_monitor/storage_info.h', + 'storage_monitor/storage_monitor.cc', + 'storage_monitor/storage_monitor.h', + 'storage_monitor/storage_monitor_chromeos.cc', + 'storage_monitor/storage_monitor_chromeos.h', + 'storage_monitor/storage_monitor_linux.cc', + 'storage_monitor/storage_monitor_linux.h', + 'storage_monitor/storage_monitor_mac.h', + 'storage_monitor/storage_monitor_mac.mm', + 'storage_monitor/storage_monitor_win.cc', + 'storage_monitor/storage_monitor_win.h', + 'storage_monitor/transient_device_ids.cc', + 'storage_monitor/transient_device_ids.h', + 'storage_monitor/udev_util_linux.cc', + 'storage_monitor/udev_util_linux.h', + 'storage_monitor/volume_mount_watcher_win.cc', + 'storage_monitor/volume_mount_watcher_win.h', + ], + 'conditions': [ + ['OS == "mac"', { + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/DiskArbitration.framework', + '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/ImageCaptureCore.framework', + ], + }, + }], + ['OS=="linux"', { + 'dependencies': [ + '../build/linux/system.gyp:udev', + '../device/media_transfer_protocol/media_transfer_protocol.gyp:device_media_transfer_protocol', + '../device/media_transfer_protocol/media_transfer_protocol.gyp:mtp_file_entry_proto', + '../device/media_transfer_protocol/media_transfer_protocol.gyp:mtp_storage_info_proto', + ], + }], + ['chromeos==1', { + 'sources!': [ + 'storage_monitor/mtab_watcher_linux.cc', + 'storage_monitor/mtab_watcher_linux.h', + 'storage_monitor/storage_monitor_linux.cc', + 'storage_monitor/storage_monitor_linux.h', + ], + }], + ], + }, + { + 'target_name': 'storage_monitor_test_support', + 'type': 'static_library', + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../base/base.gyp:base', + 'storage_monitor', + ], + 'sources': [ + 'storage_monitor/mock_removable_storage_observer.cc', + 'storage_monitor/mock_removable_storage_observer.h', + 'storage_monitor/test_media_transfer_protocol_manager_linux.cc', + 'storage_monitor/test_media_transfer_protocol_manager_linux.h', + 'storage_monitor/test_portable_device_watcher_win.cc', + 'storage_monitor/test_portable_device_watcher_win.h', + 'storage_monitor/test_storage_monitor.cc', + 'storage_monitor/test_storage_monitor.h', + 'storage_monitor/test_storage_monitor_win.cc', + 'storage_monitor/test_storage_monitor_win.h', + 'storage_monitor/test_volume_mount_watcher_win.cc', + 'storage_monitor/test_volume_mount_watcher_win.h', + ], + 'conditions': [ + ['OS=="linux"', { + 'dependencies': [ + '../device/media_transfer_protocol/media_transfer_protocol.gyp:device_media_transfer_protocol', + '../device/media_transfer_protocol/media_transfer_protocol.gyp:mtp_file_entry_proto', + ], + }], + ], + }, + ], +} diff --git a/components/storage_monitor/DEPS b/components/storage_monitor/DEPS new file mode 100644 index 0000000000000..78d81f97d26eb --- /dev/null +++ b/components/storage_monitor/DEPS @@ -0,0 +1,6 @@ +include_rules = [ + "+chromeos/disks", + "+content/public/browser", + "+content/public/test", + "+device/media_transfer_protocol", +] diff --git a/chrome/browser/storage_monitor/OWNERS b/components/storage_monitor/OWNERS similarity index 100% rename from chrome/browser/storage_monitor/OWNERS rename to components/storage_monitor/OWNERS diff --git a/chrome/browser/storage_monitor/image_capture_device.h b/components/storage_monitor/image_capture_device.h similarity index 92% rename from chrome/browser/storage_monitor/image_capture_device.h rename to components/storage_monitor/image_capture_device.h index 2ad1595091121..67de8ef9b0dc8 100644 --- a/chrome/browser/storage_monitor/image_capture_device.h +++ b/components/storage_monitor/image_capture_device.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_H_ +#define COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_H_ #import #import @@ -78,4 +78,4 @@ class ImageCaptureDeviceListener { @end -#endif // CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_H_ +#endif // COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_H_ diff --git a/chrome/browser/storage_monitor/image_capture_device.mm b/components/storage_monitor/image_capture_device.mm similarity index 98% rename from chrome/browser/storage_monitor/image_capture_device.mm rename to components/storage_monitor/image_capture_device.mm index 03ed1195d4c92..9e1fcdc9899ed 100644 --- a/chrome/browser/storage_monitor/image_capture_device.mm +++ b/components/storage_monitor/image_capture_device.mm @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "chrome/browser/storage_monitor/image_capture_device.h" +#import "components/storage_monitor/image_capture_device.h" #include "base/file_util.h" #include "content/public/browser/browser_thread.h" diff --git a/chrome/browser/storage_monitor/image_capture_device_manager.h b/components/storage_monitor/image_capture_device_manager.h similarity index 81% rename from chrome/browser/storage_monitor/image_capture_device_manager.h rename to components/storage_monitor/image_capture_device_manager.h index cfb1acacadade..cc0287a215e63 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager.h +++ b/components/storage_monitor/image_capture_device_manager.h @@ -1,15 +1,15 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_ +#define COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_ #import #include #include "base/mac/scoped_nsobject.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" @protocol ICDeviceBrowserDelegate; @class ImageCaptureDevice; @@ -45,4 +45,4 @@ class ImageCaptureDeviceManager { base::scoped_nsobject device_browser_; }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_ +#endif // COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_ diff --git a/chrome/browser/storage_monitor/image_capture_device_manager.mm b/components/storage_monitor/image_capture_device_manager.mm similarity index 95% rename from chrome/browser/storage_monitor/image_capture_device_manager.mm rename to components/storage_monitor/image_capture_device_manager.mm index a405dbaa3b52b..95b1c79b27cf9 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager.mm +++ b/components/storage_monitor/image_capture_device_manager.mm @@ -1,13 +1,13 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/image_capture_device_manager.h" +#include "components/storage_monitor/image_capture_device_manager.h" #import -#import "chrome/browser/storage_monitor/image_capture_device.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#import "components/storage_monitor/image_capture_device.h" +#include "components/storage_monitor/storage_info.h" namespace { diff --git a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm b/components/storage_monitor/image_capture_device_manager_unittest.mm similarity index 97% rename from chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm rename to components/storage_monitor/image_capture_device_manager_unittest.mm index 6d8492d0e286a..2f4aae9f8bac5 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm +++ b/components/storage_monitor/image_capture_device_manager_unittest.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,9 +11,9 @@ #include "base/mac/foundation_util.h" #include "base/memory/weak_ptr.h" #include "base/run_loop.h" -#include "chrome/browser/storage_monitor/image_capture_device.h" -#include "chrome/browser/storage_monitor/image_capture_device_manager.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/image_capture_device.h" +#include "components/storage_monitor/image_capture_device_manager.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -259,7 +259,7 @@ virtual void SetUp() OVERRIDE { } virtual void TearDown() OVERRIDE { - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } MockICCameraDevice* AttachDevice(ImageCaptureDeviceManager* manager) { diff --git a/chrome/browser/storage_monitor/media_storage_util.cc b/components/storage_monitor/media_storage_util.cc similarity index 96% rename from chrome/browser/storage_monitor/media_storage_util.cc rename to components/storage_monitor/media_storage_util.cc index d51be6d085b37..149f10cd5aa18 100644 --- a/chrome/browser/storage_monitor/media_storage_util.cc +++ b/components/storage_monitor/media_storage_util.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/media_storage_util.h" #include @@ -12,8 +12,8 @@ #include "base/metrics/histogram.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; diff --git a/chrome/browser/storage_monitor/media_storage_util.h b/components/storage_monitor/media_storage_util.h similarity index 90% rename from chrome/browser/storage_monitor/media_storage_util.h rename to components/storage_monitor/media_storage_util.h index baa1b19be7db9..ce04664ed3f86 100644 --- a/chrome/browser/storage_monitor/media_storage_util.h +++ b/components/storage_monitor/media_storage_util.h @@ -1,12 +1,12 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // MediaStorageUtil provides information about storage devices attached // to the computer. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ +#define COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ #include #include @@ -63,4 +63,4 @@ class MediaStorageUtil { DISALLOW_IMPLICIT_CONSTRUCTORS(MediaStorageUtil); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ +#endif // COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ diff --git a/chrome/browser/storage_monitor/media_storage_util_unittest.cc b/components/storage_monitor/media_storage_util_unittest.cc similarity index 92% rename from chrome/browser/storage_monitor/media_storage_util_unittest.cc rename to components/storage_monitor/media_storage_util_unittest.cc index cc38bd471f469..5f93ce1bbe0ca 100644 --- a/chrome/browser/storage_monitor/media_storage_util_unittest.cc +++ b/components/storage_monitor/media_storage_util_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,11 +9,10 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" -#include "chrome/test/base/testing_browser_process.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -67,7 +66,7 @@ class MediaStorageUtilTest : public testing::Test { virtual void TearDown() OVERRIDE { WaitForFileThread(); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } static void PostQuitToUIThread() { diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc b/components/storage_monitor/media_transfer_protocol_device_observer_linux.cc similarity index 96% rename from chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc rename to components/storage_monitor/media_transfer_protocol_device_observer_linux.cc index c336efe9ceef0..0bd73757283e2 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc +++ b/components/storage_monitor/media_transfer_protocol_device_observer_linux.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h" +#include "components/storage_monitor/media_transfer_protocol_device_observer_linux.h" #include @@ -11,8 +11,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/removable_device_constants.h" #include "device/media_transfer_protocol/mtp_storage_info.pb.h" namespace { diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h b/components/storage_monitor/media_transfer_protocol_device_observer_linux.h similarity index 88% rename from chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h rename to components/storage_monitor/media_transfer_protocol_device_observer_linux.h index 23f62da9e6623..51eaac63e69cc 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h +++ b/components/storage_monitor/media_transfer_protocol_device_observer_linux.h @@ -1,15 +1,15 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_MEDIA_TRANSFER_PROTOCOL_DEVICE_OBSERVER_LINUX_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_MEDIA_TRANSFER_PROTOCOL_DEVICE_OBSERVER_LINUX_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_MEDIA_TRANSFER_PROTOCOL_DEVICE_OBSERVER_LINUX_H_ +#define COMPONENTS_STORAGE_MONITOR_MEDIA_TRANSFER_PROTOCOL_DEVICE_OBSERVER_LINUX_H_ #include #include #include "base/strings/string16.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" namespace base { @@ -85,4 +85,4 @@ class MediaTransferProtocolDeviceObserverLinux DISALLOW_COPY_AND_ASSIGN(MediaTransferProtocolDeviceObserverLinux); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_MEDIA_TRANSFER_PROTOCOL_DEVICE_OBSERVER_LINUX_H_ +#endif // COMPONENTS_STORAGE_MONITOR_MEDIA_TRANSFER_PROTOCOL_DEVICE_OBSERVER_LINUX_H_ diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc b/components/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc similarity index 90% rename from chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc rename to components/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc index 45f84b4996853..5b9274b00bc46 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc +++ b/components/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc @@ -1,21 +1,20 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // MediaTransferProtocolDeviceObserverLinux unit tests. -#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h" +#include "components/storage_monitor/media_transfer_protocol_device_observer_linux.h" #include #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/mock_removable_storage_observer.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/test/test_browser_thread_bundle.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" #include "testing/gtest/include/gtest/gtest.h" @@ -101,10 +100,10 @@ class MediaTransferProtocolDeviceObserverLinuxTest : public testing::Test { } virtual void TearDown() OVERRIDE { - StorageMonitor* monitor = g_browser_process->storage_monitor(); + StorageMonitor* monitor = StorageMonitor::GetInstance(); monitor->RemoveObserver(mock_storage_observer_.get()); mtp_device_observer_.reset(); - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); } // Returns the device changed observer object. diff --git a/chrome/browser/storage_monitor/mock_removable_storage_observer.cc b/components/storage_monitor/mock_removable_storage_observer.cc similarity index 79% rename from chrome/browser/storage_monitor/mock_removable_storage_observer.cc rename to components/storage_monitor/mock_removable_storage_observer.cc index bf8e94068bb63..f89a8a6abcd5c 100644 --- a/chrome/browser/storage_monitor/mock_removable_storage_observer.cc +++ b/components/storage_monitor/mock_removable_storage_observer.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" +#include "components/storage_monitor/mock_removable_storage_observer.h" MockRemovableStorageObserver::MockRemovableStorageObserver() : attach_calls_(0), detach_calls_(0) { diff --git a/chrome/browser/storage_monitor/mock_removable_storage_observer.h b/components/storage_monitor/mock_removable_storage_observer.h similarity index 64% rename from chrome/browser/storage_monitor/mock_removable_storage_observer.h rename to components/storage_monitor/mock_removable_storage_observer.h index ba9eeb1be6538..9d8c57c261e94 100644 --- a/chrome/browser/storage_monitor/mock_removable_storage_observer.h +++ b/components/storage_monitor/mock_removable_storage_observer.h @@ -1,12 +1,12 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ +#define COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ -#include "chrome/browser/storage_monitor/removable_storage_observer.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/removable_storage_observer.h" +#include "components/storage_monitor/storage_info.h" class MockRemovableStorageObserver : public RemovableStorageObserver { public: @@ -36,4 +36,4 @@ class MockRemovableStorageObserver : public RemovableStorageObserver { StorageInfo last_detached_; }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ +#endif // COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ diff --git a/chrome/browser/storage_monitor/mtab_watcher_linux.cc b/components/storage_monitor/mtab_watcher_linux.cc similarity index 95% rename from chrome/browser/storage_monitor/mtab_watcher_linux.cc rename to components/storage_monitor/mtab_watcher_linux.cc index 203cb4a0f837c..353381fc4a252 100644 --- a/chrome/browser/storage_monitor/mtab_watcher_linux.cc +++ b/components/storage_monitor/mtab_watcher_linux.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // MtabWatcherLinux implementation. -#include "chrome/browser/storage_monitor/mtab_watcher_linux.h" +#include "components/storage_monitor/mtab_watcher_linux.h" #include #include diff --git a/chrome/browser/storage_monitor/mtab_watcher_linux.h b/components/storage_monitor/mtab_watcher_linux.h similarity index 86% rename from chrome/browser/storage_monitor/mtab_watcher_linux.h rename to components/storage_monitor/mtab_watcher_linux.h index cc4140d4f8af5..70787799c4f04 100644 --- a/chrome/browser/storage_monitor/mtab_watcher_linux.h +++ b/components/storage_monitor/mtab_watcher_linux.h @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,8 +6,8 @@ // notifies a StorageMonitorLinux about them. // MtabWatcherLinux lives on the FILE thread. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ +#define COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ #if defined(OS_CHROMEOS) #error "ChromeOS does not use MtabWatcherLinux." @@ -59,4 +59,4 @@ class MtabWatcherLinux { DISALLOW_COPY_AND_ASSIGN(MtabWatcherLinux); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ +#endif // COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ diff --git a/chrome/browser/storage_monitor/portable_device_watcher_win.cc b/components/storage_monitor/portable_device_watcher_win.cc similarity index 98% rename from chrome/browser/storage_monitor/portable_device_watcher_win.cc rename to components/storage_monitor/portable_device_watcher_win.cc index a206de93dd6a4..ad0a5479836e5 100644 --- a/chrome/browser/storage_monitor/portable_device_watcher_win.cc +++ b/components/storage_monitor/portable_device_watcher_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -6,7 +6,7 @@ // complete. Those tasks should be run on an blocking thread instead of the // UI thread. -#include "chrome/browser/storage_monitor/portable_device_watcher_win.h" +#include "components/storage_monitor/portable_device_watcher_win.h" #include #include @@ -20,9 +20,9 @@ #include "base/win/scoped_co_mem.h" #include "base/win/scoped_comptr.h" #include "base/win/scoped_propvariant.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" namespace { diff --git a/chrome/browser/storage_monitor/portable_device_watcher_win.h b/components/storage_monitor/portable_device_watcher_win.h similarity index 93% rename from chrome/browser/storage_monitor/portable_device_watcher_win.h rename to components/storage_monitor/portable_device_watcher_win.h index e893d1dcd5fc6..494181f2dd2e0 100644 --- a/chrome/browser/storage_monitor/portable_device_watcher_win.h +++ b/components/storage_monitor/portable_device_watcher_win.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ +#define COMPONENTS_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ #include @@ -14,7 +14,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" namespace base { class SequencedTaskRunner; @@ -139,4 +139,4 @@ class PortableDeviceWatcherWin { DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ +#endif // COMPONENTS_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ diff --git a/chrome/browser/storage_monitor/removable_device_constants.cc b/components/storage_monitor/removable_device_constants.cc similarity index 79% rename from chrome/browser/storage_monitor/removable_device_constants.cc rename to components/storage_monitor/removable_device_constants.cc index c8dacbeb02248..03fa0fd811812 100644 --- a/chrome/browser/storage_monitor/removable_device_constants.cc +++ b/components/storage_monitor/removable_device_constants.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/removable_device_constants.h" const char kFSUniqueIdPrefix[] = "UUID:"; const char kVendorModelSerialPrefix[] = "VendorModelSerial:"; diff --git a/chrome/browser/storage_monitor/removable_device_constants.h b/components/storage_monitor/removable_device_constants.h similarity index 69% rename from chrome/browser/storage_monitor/removable_device_constants.h rename to components/storage_monitor/removable_device_constants.h index 2b3ede8c9ff18..236b0971434db 100644 --- a/chrome/browser/storage_monitor/removable_device_constants.h +++ b/components/storage_monitor/removable_device_constants.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_CONSTANTS_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_CONSTANTS_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_REMOVABLE_DEVICE_CONSTANTS_H_ +#define COMPONENTS_STORAGE_MONITOR_REMOVABLE_DEVICE_CONSTANTS_H_ #include "base/files/file_path.h" #include "base/strings/string16.h" @@ -24,4 +24,4 @@ extern const base::char16 kWPDDevInterfaceGUID[]; extern const base::FilePath::CharType kDCIMDirectoryName[]; -#endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_CONSTANTS_H_ +#endif // COMPONENTS_STORAGE_MONITOR_REMOVABLE_DEVICE_CONSTANTS_H_ diff --git a/chrome/browser/storage_monitor/removable_storage_observer.h b/components/storage_monitor/removable_storage_observer.h similarity index 66% rename from chrome/browser/storage_monitor/removable_storage_observer.h rename to components/storage_monitor/removable_storage_observer.h index b458684149b55..a5db82f168db4 100644 --- a/chrome/browser/storage_monitor/removable_storage_observer.h +++ b/components/storage_monitor/removable_storage_observer.h @@ -1,11 +1,11 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_STORAGE_OBSERVER_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_STORAGE_OBSERVER_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_REMOVABLE_STORAGE_OBSERVER_H_ +#define COMPONENTS_STORAGE_MONITOR_REMOVABLE_STORAGE_OBSERVER_H_ -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" // Clients use this class to register for event-based notifications of // removable storage devices attached to or removed from the system. @@ -23,4 +23,4 @@ class RemovableStorageObserver { virtual ~RemovableStorageObserver() {} }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_STORAGE_OBSERVER_H_ +#endif // COMPONENTS_STORAGE_MONITOR_REMOVABLE_STORAGE_OBSERVER_H_ diff --git a/chrome/browser/storage_monitor/storage_info.cc b/components/storage_monitor/storage_info.cc similarity index 97% rename from chrome/browser/storage_monitor/storage_info.cc rename to components/storage_monitor/storage_info.cc index aa355008a063f..a389611d2ce38 100644 --- a/chrome/browser/storage_monitor/storage_info.cc +++ b/components/storage_monitor/storage_info.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" #include "base/logging.h" diff --git a/chrome/browser/storage_monitor/storage_info.h b/components/storage_monitor/storage_info.h similarity index 94% rename from chrome/browser/storage_monitor/storage_info.h rename to components/storage_monitor/storage_info.h index f36cc28c29a3d..45109e757a517 100644 --- a/chrome/browser/storage_monitor/storage_info.h +++ b/components/storage_monitor/storage_info.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ +#define COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ #include "base/files/file_path.h" #include "base/strings/string16.h" @@ -112,4 +112,4 @@ struct StorageInfo { uint64 total_size_in_bytes_; }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_ +#endif // COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ diff --git a/chrome/browser/storage_monitor/storage_info_unittest.cc b/components/storage_monitor/storage_info_unittest.cc similarity index 90% rename from chrome/browser/storage_monitor/storage_info_unittest.cc rename to components/storage_monitor/storage_info_unittest.cc index 36229c5699d99..34959d38a26ab 100644 --- a/chrome/browser/storage_monitor/storage_info_unittest.cc +++ b/components/storage_monitor/storage_info_unittest.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" #include "testing/gtest/include/gtest/gtest.h" const char kMtpDeviceId[] = "mtp:VendorModelSerial:ABC:1233:1237912873"; diff --git a/chrome/browser/storage_monitor/storage_monitor.cc b/components/storage_monitor/storage_monitor.cc similarity index 85% rename from chrome/browser/storage_monitor/storage_monitor.cc rename to components/storage_monitor/storage_monitor.cc index 380412d6491b4..5fd39a1905e12 100644 --- a/chrome/browser/storage_monitor/storage_monitor.cc +++ b/components/storage_monitor/storage_monitor.cc @@ -1,14 +1,19 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/storage_monitor/removable_storage_observer.h" -#include "chrome/browser/storage_monitor/transient_device_ids.h" +#include "components/storage_monitor/removable_storage_observer.h" +#include "components/storage_monitor/transient_device_ids.h" + +namespace { + +StorageMonitor* g_storage_monitor = NULL; + +} // namespace StorageMonitor::Receiver::~Receiver() { } @@ -42,11 +47,26 @@ void StorageMonitor::ReceiverImpl::MarkInitialized() { notifications_->MarkInitialized(); } +// static +void StorageMonitor::Create() { + delete g_storage_monitor; + g_storage_monitor = CreateInternal(); +} + +// static +void StorageMonitor::Destroy() { + delete g_storage_monitor; + g_storage_monitor = NULL; +} + StorageMonitor* StorageMonitor::GetInstance() { - if (g_browser_process) - return g_browser_process->storage_monitor(); + return g_storage_monitor; +} - return NULL; +void StorageMonitor::SetStorageMonitorForTesting( + scoped_ptr storage_monitor) { + delete g_storage_monitor; + g_storage_monitor = storage_monitor.release(); } std::vector StorageMonitor::GetAllAvailableStorages() const { diff --git a/chrome/browser/storage_monitor/storage_monitor.h b/components/storage_monitor/storage_monitor.h similarity index 88% rename from chrome/browser/storage_monitor/storage_monitor.h rename to components/storage_monitor/storage_monitor.h index e723aa7482527..30c48dded6803 100644 --- a/chrome/browser/storage_monitor/storage_monitor.h +++ b/components/storage_monitor/storage_monitor.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_H_ +#define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_H_ #include #include @@ -11,11 +11,12 @@ #include "base/callback.h" #include "base/files/file_path.h" +#include "base/memory/scoped_ptr.h" #include "base/observer_list_threadsafe.h" #include "base/strings/string16.h" #include "base/synchronization/lock.h" #include "base/threading/thread_checker.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" class MediaFileSystemRegistryTest; class MediaGalleriesPlatformAppBrowserTest; @@ -64,9 +65,13 @@ class StorageMonitor { EJECT_FAILURE }; - // Returns a pointer to a newly created per-platform object with the - // StorageMonitor interface. - static StorageMonitor* Create(); + // Instantiates the StorageMonitor singleton. This function does not + // guarantee the complete initialization of the object. For that, see + // |EnsureInitialized|. + static void Create(); + + // Destroys the StorageMonitor singleton. + static void Destroy(); // Returns a pointer to an object owned by BrowserProcess, with lifetime // starting before main message loop start, and ending after main message loop @@ -74,6 +79,9 @@ class StorageMonitor { // returns NULL. static StorageMonitor* GetInstance(); + static void SetStorageMonitorForTesting( + scoped_ptr storage_monitor); + virtual ~StorageMonitor(); // Ensures that the storage monitor is initialized. The provided callback, if @@ -147,6 +155,9 @@ class StorageMonitor { void MarkInitialized(); private: + // Internal method for creating platform specific StorageMonitor. + static StorageMonitor* CreateInternal(); + class ReceiverImpl; friend class ReceiverImpl; @@ -177,4 +188,4 @@ class StorageMonitor { scoped_ptr transient_device_ids_; }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ +#endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc b/components/storage_monitor/storage_monitor_chromeos.cc similarity index 96% rename from chrome/browser/storage_monitor/storage_monitor_chromeos.cc rename to components/storage_monitor/storage_monitor_chromeos.cc index 6b090c39f976c..7428b1d87b5c5 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc +++ b/components/storage_monitor/storage_monitor_chromeos.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // chromeos::StorageMonitorCros implementation. -#include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" +#include "components/storage_monitor/storage_monitor_chromeos.h" #include "base/files/file_path.h" #include "base/logging.h" @@ -13,9 +13,9 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/media_transfer_protocol_device_observer_linux.h" +#include "components/storage_monitor/removable_device_constants.h" #include "content/public/browser/browser_thread.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" @@ -307,6 +307,6 @@ void StorageMonitorCros::AddMountedPath( } // namespace chromeos -StorageMonitor* StorageMonitor::Create() { +StorageMonitor* StorageMonitor::CreateInternal() { return new chromeos::StorageMonitorCros(); } diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos.h b/components/storage_monitor/storage_monitor_chromeos.h similarity index 91% rename from chrome/browser/storage_monitor/storage_monitor_chromeos.h rename to components/storage_monitor/storage_monitor_chromeos.h index 048a3aef162a5..63317534de59d 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos.h +++ b/components/storage_monitor/storage_monitor_chromeos.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,8 +6,8 @@ // listeners about the addition and deletion of media devices. // This class lives on the UI thread. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ +#define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ #if !defined(OS_CHROMEOS) #error "Should only be used on ChromeOS." @@ -20,8 +20,8 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" #include "chromeos/disks/disk_mount_manager.h" +#include "components/storage_monitor/storage_monitor.h" class MediaTransferProtocolDeviceObserverLinux; @@ -94,4 +94,4 @@ class StorageMonitorCros : public StorageMonitor, } // namespace chromeos -#endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ +#endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc b/components/storage_monitor/storage_monitor_chromeos_unittest.cc similarity index 96% rename from chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc rename to components/storage_monitor/storage_monitor_chromeos_unittest.cc index 79583bbae8b62..b47cb125749a5 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc +++ b/components/storage_monitor/storage_monitor_chromeos_unittest.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // chromeos::StorageMonitorCros unit tests. -#include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" +#include "components/storage_monitor/storage_monitor_chromeos.h" #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" @@ -12,13 +12,12 @@ #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" -#include "chrome/test/base/testing_browser_process.h" #include "chromeos/disks/mock_disk_mount_manager.h" +#include "components/storage_monitor/mock_removable_storage_observer.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/test_media_transfer_protocol_manager_linux.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -171,12 +170,10 @@ void StorageMonitorCrosTest::SetUp() { mock_storage_observer_.reset(new MockRemovableStorageObserver); // Initialize the test subject. - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); monitor_ = new TestStorageMonitorCros(); scoped_ptr pass_monitor(monitor_); - TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); - DCHECK(browser_process); - browser_process->SetStorageMonitor(pass_monitor.Pass()); + StorageMonitor::SetStorageMonitorForTesting(pass_monitor.Pass()); monitor_->Init(); monitor_->AddObserver(mock_storage_observer_.get()); diff --git a/chrome/browser/storage_monitor/storage_monitor_linux.cc b/components/storage_monitor/storage_monitor_linux.cc similarity index 97% rename from chrome/browser/storage_monitor/storage_monitor_linux.cc rename to components/storage_monitor/storage_monitor_linux.cc index 5e2cba15c5f50..f18a133cd1278 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux.cc +++ b/components/storage_monitor/storage_monitor_linux.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // StorageMonitorLinux implementation. -#include "chrome/browser/storage_monitor/storage_monitor_linux.h" +#include "components/storage_monitor/storage_monitor_linux.h" #include #include @@ -20,11 +20,11 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/udev_util_linux.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/media_transfer_protocol_device_observer_linux.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/udev_util_linux.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" using content::BrowserThread; @@ -496,7 +496,7 @@ void StorageMonitorLinux::AddNewMount(const base::FilePath& mount_device, receiver()->ProcessAttach(*storage_info); } -StorageMonitor* StorageMonitor::Create() { +StorageMonitor* StorageMonitor::CreateInternal() { const base::FilePath kDefaultMtabPath("/etc/mtab"); return new StorageMonitorLinux(kDefaultMtabPath); } diff --git a/chrome/browser/storage_monitor/storage_monitor_linux.h b/components/storage_monitor/storage_monitor_linux.h similarity index 93% rename from chrome/browser/storage_monitor/storage_monitor_linux.h rename to components/storage_monitor/storage_monitor_linux.h index 18f2cbb3a6ade..74ee26068aebc 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux.h +++ b/components/storage_monitor/storage_monitor_linux.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,8 +8,8 @@ // StorageMonitorLinux lives on the UI thread, and uses a MtabWatcherLinux on // the FILE thread to get mount point change events. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ +#define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ #if defined(OS_CHROMEOS) #error "Use the ChromeOS-specific implementation instead." @@ -24,8 +24,8 @@ #include "base/files/file_path_watcher.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/storage_monitor/mtab_watcher_linux.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/mtab_watcher_linux.h" +#include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" class MediaTransferProtocolDeviceObserverLinux; @@ -139,4 +139,4 @@ class StorageMonitorLinux : public StorageMonitor, DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ +#endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc b/components/storage_monitor/storage_monitor_linux_unittest.cc similarity index 96% rename from chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc rename to components/storage_monitor/storage_monitor_linux_unittest.cc index 10cd20e9c4fcd..3b37e0a9ef0a2 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc +++ b/components/storage_monitor/storage_monitor_linux_unittest.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // StorageMonitorLinux unit tests. -#include "chrome/browser/storage_monitor/storage_monitor_linux.h" +#include "components/storage_monitor/storage_monitor_linux.h" #include #include @@ -17,13 +17,12 @@ #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" -#include "chrome/test/base/testing_browser_process.h" +#include "components/storage_monitor/mock_removable_storage_observer.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_media_transfer_protocol_manager_linux.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -173,12 +172,7 @@ class StorageMonitorLinuxTest : public testing::Test { arraysize(initial_test_data), true /* overwrite */); - TestStorageMonitor::RemoveSingleton(); - monitor_ = new TestStorageMonitorLinux(mtab_file_); - scoped_ptr pass_monitor(monitor_); - TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); - DCHECK(browser_process); - browser_process->SetStorageMonitor(pass_monitor.Pass()); + monitor_.reset(new TestStorageMonitorLinux(mtab_file_)); mock_storage_observer_.reset(new MockRemovableStorageObserver); monitor_->AddObserver(mock_storage_observer_.get()); @@ -193,7 +187,7 @@ class StorageMonitorLinuxTest : public testing::Test { base::RunLoop().RunUntilIdle(); // Linux storage monitor must be destroyed on the UI thread, so do it here. - TestStorageMonitor::RemoveSingleton(); + monitor_.reset(); } // Append mtab entries from the |data| array of size |data_size| to the mtab @@ -242,7 +236,7 @@ class StorageMonitorLinuxTest : public testing::Test { } StorageMonitor* notifier() { - return monitor_; + return monitor_.get(); } uint64 GetStorageSize(const base::FilePath& path) { @@ -312,7 +306,7 @@ class StorageMonitorLinuxTest : public testing::Test { // Path to the test mtab file. base::FilePath mtab_file_; - TestStorageMonitorLinux* monitor_; + scoped_ptr monitor_; DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinuxTest); }; diff --git a/chrome/browser/storage_monitor/storage_monitor_mac.h b/components/storage_monitor/storage_monitor_mac.h similarity index 87% rename from chrome/browser/storage_monitor/storage_monitor_mac.h rename to components/storage_monitor/storage_monitor_mac.h index 76a0b2105dd57..7fa123127f106 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac.h +++ b/components/storage_monitor/storage_monitor_mac.h @@ -1,16 +1,16 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ +#define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ #include #include #include "base/mac/scoped_cftyperef.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" class ImageCaptureDeviceManager; @@ -69,4 +69,4 @@ class StorageMonitorMac : public StorageMonitor, DISALLOW_COPY_AND_ASSIGN(StorageMonitorMac); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ +#endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_mac.mm b/components/storage_monitor/storage_monitor_mac.mm similarity index 97% rename from chrome/browser/storage_monitor/storage_monitor_mac.mm rename to components/storage_monitor/storage_monitor_mac.mm index a3439769d9356..b3267491e890a 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac.mm +++ b/components/storage_monitor/storage_monitor_mac.mm @@ -1,16 +1,16 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/storage_monitor_mac.h" +#include "components/storage_monitor/storage_monitor_mac.h" #include "base/mac/foundation_util.h" #include "base/mac/mac_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/image_capture_device_manager.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/image_capture_device_manager.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" namespace { @@ -382,6 +382,6 @@ void EjectDisk(EjectDiskOptions* options) { return false; } -StorageMonitor* StorageMonitor::Create() { +StorageMonitor* StorageMonitor::CreateInternal() { return new StorageMonitorMac(); } diff --git a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm b/components/storage_monitor/storage_monitor_mac_unittest.mm similarity index 88% rename from chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm rename to components/storage_monitor/storage_monitor_mac_unittest.mm index 29f888e9a895e..9b636019e3702 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm +++ b/components/storage_monitor/storage_monitor_mac_unittest.mm @@ -1,20 +1,21 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/storage_monitor_mac.h" +#include "components/storage_monitor/storage_monitor_mac.h" +#include "base/bind_helpers.h" #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/mac/foundation_util.h" #include "base/run_loop.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" -#include "chrome/test/base/testing_browser_process.h" +#include "components/storage_monitor/mock_removable_storage_observer.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/test_storage_monitor.h" +#include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -40,12 +41,7 @@ StorageInfo CreateStorageInfo( StorageMonitorMacTest() {} virtual void SetUp() OVERRIDE { - TestStorageMonitor::RemoveSingleton(); - monitor_ = new StorageMonitorMac; - scoped_ptr pass_monitor(monitor_); - TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); - DCHECK(browser_process); - browser_process->SetStorageMonitor(pass_monitor.Pass()); + monitor_.reset(new StorageMonitorMac); mock_storage_observer_.reset(new MockRemovableStorageObserver); monitor_->AddObserver(mock_storage_observer_.get()); @@ -61,7 +57,7 @@ virtual void SetUp() OVERRIDE { void UpdateDisk(StorageInfo info, StorageMonitorMac::UpdateType update_type) { content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, base::Bind(&StorageMonitorMac::UpdateDisk, - base::Unretained(monitor_), + base::Unretained(monitor_.get()), "dummy_bsd_name", info, update_type)); base::RunLoop().RunUntilIdle(); } @@ -77,7 +73,7 @@ void UpdateDisk(StorageInfo info, StorageMonitorMac::UpdateType update_type) { std::string device_id_; StorageInfo disk_info_; - StorageMonitorMac* monitor_; + scoped_ptr monitor_; }; TEST_F(StorageMonitorMacTest, AddRemove) { diff --git a/chrome/browser/storage_monitor/storage_monitor_unittest.cc b/components/storage_monitor/storage_monitor_unittest.cc similarity index 92% rename from chrome/browser/storage_monitor/storage_monitor_unittest.cc rename to components/storage_monitor/storage_monitor_unittest.cc index 8466108771c1f..82a6574709793 100644 --- a/chrome/browser/storage_monitor/storage_monitor_unittest.cc +++ b/components/storage_monitor/storage_monitor_unittest.cc @@ -1,13 +1,13 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" -#include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/mock_removable_storage_observer.h" +#include "components/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -19,7 +19,7 @@ void SetLatch(bool* called) { } // namespace TEST(StorageMonitorTest, TestInitialize) { - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); TestStorageMonitor monitor; EXPECT_FALSE(monitor.init_called()); @@ -32,7 +32,7 @@ TEST(StorageMonitorTest, TestInitialize) { } TEST(StorageMonitorTest, DeviceAttachDetachNotifications) { - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); base::MessageLoop message_loop; const base::string16 kDeviceName = base::ASCIIToUTF16("media device"); const std::string kDeviceId1 = "dcim:UUID:FFF0-0001"; @@ -80,7 +80,7 @@ TEST(StorageMonitorTest, DeviceAttachDetachNotifications) { } TEST(StorageMonitorTest, GetAllAvailableStoragesEmpty) { - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); base::MessageLoop message_loop; TestStorageMonitor monitor; std::vector devices = monitor.GetAllAvailableStorages(); @@ -88,7 +88,7 @@ TEST(StorageMonitorTest, GetAllAvailableStoragesEmpty) { } TEST(StorageMonitorTest, GetAllAvailableStorageAttachDetach) { - TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::Destroy(); base::MessageLoop message_loop; TestStorageMonitor monitor; const std::string kDeviceId1 = "dcim:UUID:FFF0-0042"; diff --git a/chrome/browser/storage_monitor/storage_monitor_win.cc b/components/storage_monitor/storage_monitor_win.cc similarity index 92% rename from chrome/browser/storage_monitor/storage_monitor_win.cc rename to components/storage_monitor/storage_monitor_win.cc index 67ed23ccfc45d..ccc8aecec14af 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win.cc +++ b/components/storage_monitor/storage_monitor_win.cc @@ -1,18 +1,18 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/storage_monitor_win.h" +#include "components/storage_monitor/storage_monitor_win.h" #include #include #include #include "base/win/wrapped_window_proc.h" -#include "chrome/browser/storage_monitor/portable_device_watcher_win.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" +#include "components/storage_monitor/portable_device_watcher_win.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/volume_mount_watcher_win.h" // StorageMonitorWin ------------------------------------------------------- @@ -158,7 +158,7 @@ void StorageMonitorWin::OnDeviceChange(UINT event_type, LPARAM data) { portable_device_watcher_->OnWindowMessage(event_type, data); } -StorageMonitor* StorageMonitor::Create() { +StorageMonitor* StorageMonitor::CreateInternal() { return new StorageMonitorWin(new VolumeMountWatcherWin(), new PortableDeviceWatcherWin()); } diff --git a/chrome/browser/storage_monitor/storage_monitor_win.h b/components/storage_monitor/storage_monitor_win.h similarity index 83% rename from chrome/browser/storage_monitor/storage_monitor_win.h rename to components/storage_monitor/storage_monitor_win.h index d75b66227c6bd..773c7fe87d4be 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win.h +++ b/components/storage_monitor/storage_monitor_win.h @@ -1,14 +1,14 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ +#define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ #include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" namespace base { class FilePath; @@ -20,6 +20,13 @@ class VolumeMountWatcherWin; class StorageMonitorWin : public StorageMonitor { public: + // Should only be called by browser start up code. + // Use StorageMonitor::GetInstance() instead. + // To support unit tests, this constructor takes |volume_mount_watcher| and + // |portable_device_watcher| objects. These params are either constructed in + // unit tests or in StorageMonitorWin CreateInternal() function. + StorageMonitorWin(VolumeMountWatcherWin* volume_mount_watcher, + PortableDeviceWatcherWin* portable_device_watcher); virtual ~StorageMonitorWin(); // Must be called after the file thread is created. @@ -40,13 +47,6 @@ class StorageMonitorWin : public StorageMonitor { private: class PortableDeviceNotifications; friend class TestStorageMonitorWin; - friend StorageMonitor* StorageMonitor::Create(); - - // To support unit tests, this constructor takes |volume_mount_watcher| and - // |portable_device_watcher| objects. These params are either constructed in - // unit tests or in StorageMonitorWin Create() function. - StorageMonitorWin(VolumeMountWatcherWin* volume_mount_watcher, - PortableDeviceWatcherWin* portable_device_watcher); // Gets the removable storage information given a |device_path|. On success, // returns true and fills in |info|. @@ -78,4 +78,4 @@ class StorageMonitorWin : public StorageMonitor { DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ +#endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc b/components/storage_monitor/storage_monitor_win_unittest.cc similarity index 92% rename from chrome/browser/storage_monitor/storage_monitor_win_unittest.cc rename to components/storage_monitor/storage_monitor_win_unittest.cc index 4ce88edd100b5..6ef9e0dda88d6 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc +++ b/components/storage_monitor/storage_monitor_win_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,17 +13,16 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" -#include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" -#include "chrome/browser/storage_monitor/portable_device_watcher_win.h" -#include "chrome/browser/storage_monitor/removable_device_constants.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor_win.h" -#include "chrome/browser/storage_monitor/test_portable_device_watcher_win.h" -#include "chrome/browser/storage_monitor/test_storage_monitor.h" -#include "chrome/browser/storage_monitor/test_storage_monitor_win.h" -#include "chrome/browser/storage_monitor/test_volume_mount_watcher_win.h" -#include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" -#include "chrome/test/base/testing_browser_process.h" +#include "components/storage_monitor/mock_removable_storage_observer.h" +#include "components/storage_monitor/portable_device_watcher_win.h" +#include "components/storage_monitor/removable_device_constants.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor_win.h" +#include "components/storage_monitor/test_portable_device_watcher_win.h" +#include "components/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor_win.h" +#include "components/storage_monitor/test_volume_mount_watcher_win.h" +#include "components/storage_monitor/volume_mount_watcher_win.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -64,7 +63,7 @@ class StorageMonitorWinTest : public testing::Test { base::string16* pnp_device_id, base::string16* storage_object_id); - TestStorageMonitorWin* monitor_; + scoped_ptr monitor_; // Weak pointer; owned by the device notifications class. TestVolumeMountWatcherWin* volume_mount_watcher_; @@ -84,14 +83,9 @@ StorageMonitorWinTest::~StorageMonitorWinTest() { } void StorageMonitorWinTest::SetUp() { - TestStorageMonitor::RemoveSingleton(); volume_mount_watcher_ = new TestVolumeMountWatcherWin; - monitor_ = new TestStorageMonitorWin(volume_mount_watcher_, - new TestPortableDeviceWatcherWin); - scoped_ptr pass_monitor(monitor_); - TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); - DCHECK(browser_process); - browser_process->SetStorageMonitor(pass_monitor.Pass()); + monitor_.reset(new TestStorageMonitorWin(volume_mount_watcher_, + new TestPortableDeviceWatcherWin)); monitor_->Init(); RunUntilIdle(); @@ -102,16 +96,14 @@ void StorageMonitorWinTest::TearDown() { RunUntilIdle(); monitor_->RemoveObserver(&observer_); volume_mount_watcher_->ShutdownWorkerPool(); - monitor_ = NULL; // Windows storage monitor must be destroyed on the same thread // as construction. - TestStorageMonitor::RemoveSingleton(); + monitor_.reset(); } void StorageMonitorWinTest::PreAttachDevices() { - TestStorageMonitor::RemoveSingleton(); - monitor_ = NULL; + monitor_.reset(); volume_mount_watcher_ = new TestVolumeMountWatcherWin; volume_mount_watcher_->SetAttachedDevicesFake(); @@ -126,12 +118,8 @@ void StorageMonitorWinTest::PreAttachDevices() { expect_attach_calls++; } - monitor_ = new TestStorageMonitorWin(volume_mount_watcher_, - new TestPortableDeviceWatcherWin); - scoped_ptr pass_monitor(monitor_); - TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); - DCHECK(browser_process); - browser_process->SetStorageMonitor(pass_monitor.Pass()); + monitor_.reset(new TestStorageMonitorWin(volume_mount_watcher_, + new TestPortableDeviceWatcherWin)); monitor_->AddObserver(&observer_); monitor_->Init(); diff --git a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc b/components/storage_monitor/test_media_transfer_protocol_manager_linux.cc similarity index 94% rename from chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc rename to components/storage_monitor/test_media_transfer_protocol_manager_linux.cc index b61f7c5f8681e..0fdfe50c5d486 100644 --- a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc +++ b/components/storage_monitor/test_media_transfer_protocol_manager_linux.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h" +#include "components/storage_monitor/test_media_transfer_protocol_manager_linux.h" #include "device/media_transfer_protocol/mtp_file_entry.pb.h" diff --git a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h b/components/storage_monitor/test_media_transfer_protocol_manager_linux.h similarity index 88% rename from chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h rename to components/storage_monitor/test_media_transfer_protocol_manager_linux.h index db14aa5ba4165..34d163b45d66d 100644 --- a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h +++ b/components/storage_monitor/test_media_transfer_protocol_manager_linux.h @@ -1,9 +1,9 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_LINUX_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_LINUX_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_LINUX_H_ +#define COMPONENTS_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_LINUX_H_ #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" @@ -54,4 +54,4 @@ class TestMediaTransferProtocolManagerLinux DISALLOW_COPY_AND_ASSIGN(TestMediaTransferProtocolManagerLinux); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_LINUX_H_ +#endif // COMPONENTS_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_LINUX_H_ diff --git a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc b/components/storage_monitor/test_portable_device_watcher_win.cc similarity index 97% rename from chrome/browser/storage_monitor/test_portable_device_watcher_win.cc rename to components/storage_monitor/test_portable_device_watcher_win.cc index 5bb197663b13f..5a85a25c99a90 100644 --- a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc +++ b/components/storage_monitor/test_portable_device_watcher_win.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // TestPortableDeviceWatcherWin implementation. -#include "chrome/browser/storage_monitor/test_portable_device_watcher_win.h" +#include "components/storage_monitor/test_portable_device_watcher_win.h" #include diff --git a/chrome/browser/storage_monitor/test_portable_device_watcher_win.h b/components/storage_monitor/test_portable_device_watcher_win.h similarity index 88% rename from chrome/browser/storage_monitor/test_portable_device_watcher_win.h rename to components/storage_monitor/test_portable_device_watcher_win.h index a81cb4020de79..976a5acf29368 100644 --- a/chrome/browser/storage_monitor/test_portable_device_watcher_win.h +++ b/components/storage_monitor/test_portable_device_watcher_win.h @@ -1,17 +1,17 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // This file contains a subclass of PortableDeviceWatcherWin to expose some // functionality for testing. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ +#define COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ #include #include "base/strings/string16.h" -#include "chrome/browser/storage_monitor/portable_device_watcher_win.h" +#include "components/storage_monitor/portable_device_watcher_win.h" class TestPortableDeviceWatcherWin : public PortableDeviceWatcherWin { public: @@ -73,4 +73,4 @@ class TestPortableDeviceWatcherWin : public PortableDeviceWatcherWin { DISALLOW_COPY_AND_ASSIGN(TestPortableDeviceWatcherWin); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ +#endif // COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ diff --git a/chrome/browser/storage_monitor/test_storage_monitor.cc b/components/storage_monitor/test_storage_monitor.cc similarity index 66% rename from chrome/browser/storage_monitor/test_storage_monitor.cc rename to components/storage_monitor/test_storage_monitor.cc index c7ed8e6b6d48d..5be63dd4c6195 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor.cc +++ b/components/storage_monitor/test_storage_monitor.cc @@ -1,18 +1,15 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/test_storage_monitor.h" +#include "components/storage_monitor/test_storage_monitor.h" #include "base/run_loop.h" #include "base/synchronization/waitable_event.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/browser_process_impl.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/test/base/testing_browser_process.h" +#include "components/storage_monitor/storage_info.h" #if defined(OS_LINUX) -#include "chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h" +#include "components/storage_monitor/test_media_transfer_protocol_manager_linux.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" #endif @@ -33,39 +30,30 @@ TestStorageMonitor* TestStorageMonitor::CreateAndInstall() { scoped_ptr pass_monitor(monitor); monitor->Init(); monitor->MarkInitialized(); - TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); - if (browser_process) { - DCHECK(browser_process->storage_monitor() == NULL); - browser_process->SetStorageMonitor(pass_monitor.Pass()); + + if (StorageMonitor::GetInstance() == NULL) { + StorageMonitor::SetStorageMonitorForTesting(pass_monitor.Pass()); return monitor; } + return NULL; } // static TestStorageMonitor* TestStorageMonitor::CreateForBrowserTests() { - TestStorageMonitor* return_monitor = new TestStorageMonitor(); - return_monitor->Init(); - return_monitor->MarkInitialized(); - - scoped_ptr monitor(return_monitor); - BrowserProcessImpl* browser_process = - static_cast(g_browser_process); - DCHECK(browser_process); - browser_process->set_storage_monitor_for_test(monitor.Pass()); - return return_monitor; -} + TestStorageMonitor* monitor = new TestStorageMonitor(); + monitor->Init(); + monitor->MarkInitialized(); -// static -void TestStorageMonitor::RemoveSingleton() { - TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); - if (browser_process) - browser_process->SetStorageMonitor(scoped_ptr()); + scoped_ptr pass_monitor(monitor); + StorageMonitor::SetStorageMonitorForTesting(pass_monitor.Pass()); + + return monitor; } // static void TestStorageMonitor::SyncInitialize() { - StorageMonitor* monitor = g_browser_process->storage_monitor(); + StorageMonitor* monitor = StorageMonitor::GetInstance(); if (monitor->IsInitialized()) return; diff --git a/chrome/browser/storage_monitor/test_storage_monitor.h b/components/storage_monitor/test_storage_monitor.h similarity index 62% rename from chrome/browser/storage_monitor/test_storage_monitor.h rename to components/storage_monitor/test_storage_monitor.h index 8a2e4ef648bc9..bdd053790fb84 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor.h +++ b/components/storage_monitor/test_storage_monitor.h @@ -1,13 +1,13 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_H_ +#define COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_H_ #include -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_monitor.h" class TestStorageMonitor : public StorageMonitor { public: @@ -19,21 +19,16 @@ class TestStorageMonitor : public StorageMonitor { void MarkInitialized(); // Create and initialize a new TestStorageMonitor and install it - // in the TestingBrowserProcess. The TestingBrowserProcess owns the created - // TestStorageMonitor, but it is also returned for convenience. If there is - // no TestingBrowserProcess to own the TestStorageMonitor, it is destroyed - // and the return value is NULL. + // as the StorageMonitor singleton. If there is a StorageMonitor instance + // already in place, NULL is returned, otherwise the TestStorageMonitor + // instance is returned. Use |Destroy| to delete the singleton. static TestStorageMonitor* CreateAndInstall(); - // Create and initialize a new TestStorageMonitor, and install it - // in the BrowserProcessImpl. (Browser tests use the production browser - // process implementation.) The BrowserProcessImpl owns the created - // TestStorageMonitor, but it is also returned for convenience. + // Create and initialize a new TestStorageMonitor and install it + // as the StorageMonitor singleton. TestStorageMonitor is returned for + // convenience. Use |Destroy| to delete the singleton. static TestStorageMonitor* CreateForBrowserTests(); - // Remove the singleton StorageMonitor from the TestingBrowserProcess. - static void RemoveSingleton(); - // Synchronously initialize the current storage monitor. static void SyncInitialize(); @@ -77,4 +72,4 @@ class TestStorageMonitor : public StorageMonitor { #endif }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_H_ +#endif // COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_H_ diff --git a/chrome/browser/storage_monitor/test_storage_monitor_win.cc b/components/storage_monitor/test_storage_monitor_win.cc similarity index 74% rename from chrome/browser/storage_monitor/test_storage_monitor_win.cc rename to components/storage_monitor/test_storage_monitor_win.cc index 2955aecbd29e3..7e12e64de3242 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor_win.cc +++ b/components/storage_monitor/test_storage_monitor_win.cc @@ -1,13 +1,13 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // TestStorageMonitorWin implementation. -#include "chrome/browser/storage_monitor/test_storage_monitor_win.h" +#include "components/storage_monitor/test_storage_monitor_win.h" -#include "chrome/browser/storage_monitor/test_portable_device_watcher_win.h" -#include "chrome/browser/storage_monitor/test_volume_mount_watcher_win.h" +#include "components/storage_monitor/test_portable_device_watcher_win.h" +#include "components/storage_monitor/test_volume_mount_watcher_win.h" TestStorageMonitorWin::TestStorageMonitorWin( TestVolumeMountWatcherWin* volume_mount_watcher, diff --git a/chrome/browser/storage_monitor/test_storage_monitor_win.h b/components/storage_monitor/test_storage_monitor_win.h similarity index 70% rename from chrome/browser/storage_monitor/test_storage_monitor_win.h rename to components/storage_monitor/test_storage_monitor_win.h index 9d0702f71844a..dd14a762be404 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor_win.h +++ b/components/storage_monitor/test_storage_monitor_win.h @@ -1,17 +1,17 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // This file contains a subclass of StorageMonitorWin to simulate device // changed events for testing. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_ +#define COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_ #include #include "base/memory/ref_counted.h" -#include "chrome/browser/storage_monitor/storage_monitor_win.h" +#include "components/storage_monitor/storage_monitor_win.h" class TestPortableDeviceWatcherWin; class TestVolumeMountWatcherWin; @@ -34,4 +34,4 @@ class TestStorageMonitorWin: public StorageMonitorWin { DISALLOW_COPY_AND_ASSIGN(TestStorageMonitorWin); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_ +#endif // COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_ diff --git a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc b/components/storage_monitor/test_volume_mount_watcher_win.cc similarity index 96% rename from chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc rename to components/storage_monitor/test_volume_mount_watcher_win.cc index 151bc1fca1010..f5591f546e0ee 100644 --- a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc +++ b/components/storage_monitor/test_volume_mount_watcher_win.cc @@ -1,16 +1,16 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // TestVolumeMountWatcherWin implementation. -#include "chrome/browser/storage_monitor/test_volume_mount_watcher_win.h" +#include "components/storage_monitor/test_volume_mount_watcher_win.h" #include "base/bind.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" namespace { diff --git a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.h b/components/storage_monitor/test_volume_mount_watcher_win.h similarity index 83% rename from chrome/browser/storage_monitor/test_volume_mount_watcher_win.h rename to components/storage_monitor/test_volume_mount_watcher_win.h index 0ba3887cdbe04..35060db294f6e 100644 --- a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.h +++ b/components/storage_monitor/test_volume_mount_watcher_win.h @@ -1,19 +1,19 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // This file contains a subclass of VolumeMountWatcherWin to expose some // functionality for testing. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ +#define COMPONENTS_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ #include #include #include "base/strings/string16.h" #include "base/synchronization/waitable_event.h" -#include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" +#include "components/storage_monitor/volume_mount_watcher_win.h" namespace base { class FilePath; @@ -64,4 +64,4 @@ class TestVolumeMountWatcherWin : public VolumeMountWatcherWin { DISALLOW_COPY_AND_ASSIGN(TestVolumeMountWatcherWin); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ +#endif // COMPONENTS_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ diff --git a/chrome/browser/storage_monitor/transient_device_ids.cc b/components/storage_monitor/transient_device_ids.cc similarity index 84% rename from chrome/browser/storage_monitor/transient_device_ids.cc rename to components/storage_monitor/transient_device_ids.cc index 6027044f84cda..c69d251ab4997 100644 --- a/chrome/browser/storage_monitor/transient_device_ids.cc +++ b/components/storage_monitor/transient_device_ids.cc @@ -1,15 +1,15 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // TransientDeviceIds implementation. -#include "chrome/browser/storage_monitor/transient_device_ids.h" +#include "components/storage_monitor/transient_device_ids.h" #include "base/guid.h" #include "base/logging.h" #include "base/stl_util.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_info.h" TransientDeviceIds::TransientDeviceIds() {} diff --git a/chrome/browser/storage_monitor/transient_device_ids.h b/components/storage_monitor/transient_device_ids.h similarity index 83% rename from chrome/browser/storage_monitor/transient_device_ids.h rename to components/storage_monitor/transient_device_ids.h index a0c9a82b2e078..7ebf0a282e44d 100644 --- a/chrome/browser/storage_monitor/transient_device_ids.h +++ b/components/storage_monitor/transient_device_ids.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,8 +7,8 @@ // gets mapped to a transient ID, the mapping remains valid for the duration of // TransientDeviceIds' lifetime. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_TRANSIENT_DEVICE_IDS_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_TRANSIENT_DEVICE_IDS_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_TRANSIENT_DEVICE_IDS_H_ +#define COMPONENTS_STORAGE_MONITOR_TRANSIENT_DEVICE_IDS_H_ #include #include @@ -42,4 +42,4 @@ class TransientDeviceIds { DISALLOW_COPY_AND_ASSIGN(TransientDeviceIds); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_TRANSIENT_DEVICE_IDS_H_ +#endif // COMPONENTS_STORAGE_MONITOR_TRANSIENT_DEVICE_IDS_H_ diff --git a/chrome/browser/storage_monitor/udev_util_linux.cc b/components/storage_monitor/udev_util_linux.cc similarity index 89% rename from chrome/browser/storage_monitor/udev_util_linux.cc rename to components/storage_monitor/udev_util_linux.cc index 0231df0b1b9ba..db32f82c1450f 100644 --- a/chrome/browser/storage_monitor/udev_util_linux.cc +++ b/components/storage_monitor/udev_util_linux.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/udev_util_linux.h" +#include "components/storage_monitor/udev_util_linux.h" #include "base/files/file_path.h" diff --git a/chrome/browser/storage_monitor/udev_util_linux.h b/components/storage_monitor/udev_util_linux.h similarity index 82% rename from chrome/browser/storage_monitor/udev_util_linux.h rename to components/storage_monitor/udev_util_linux.h index 31497560ed477..203f2824fa8fc 100644 --- a/chrome/browser/storage_monitor/udev_util_linux.h +++ b/components/storage_monitor/udev_util_linux.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_ +#define COMPONENTS_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_ #include @@ -39,4 +39,4 @@ bool GetUdevDevicePropertyValueByPath(const base::FilePath& device_path, const char* key, std::string* result); -#endif // CHROME_BROWSER_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_ +#endif // COMPONENTS_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_ diff --git a/chrome/browser/storage_monitor/volume_mount_watcher_win.cc b/components/storage_monitor/volume_mount_watcher_win.cc similarity index 98% rename from chrome/browser/storage_monitor/volume_mount_watcher_win.cc rename to components/storage_monitor/volume_mount_watcher_win.cc index 8dd811a43ebab..fe827205d551b 100644 --- a/chrome/browser/storage_monitor/volume_mount_watcher_win.cc +++ b/components/storage_monitor/volume_mount_watcher_win.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" +#include "components/storage_monitor/volume_mount_watcher_win.h" #include @@ -20,8 +20,8 @@ #include "base/task_runner_util.h" #include "base/time/time.h" #include "base/win/scoped_handle.h" -#include "chrome/browser/storage_monitor/media_storage_util.h" -#include "chrome/browser/storage_monitor/storage_info.h" +#include "components/storage_monitor/media_storage_util.h" +#include "components/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/user_metrics.h" diff --git a/chrome/browser/storage_monitor/volume_mount_watcher_win.h b/components/storage_monitor/volume_mount_watcher_win.h similarity index 91% rename from chrome/browser/storage_monitor/volume_mount_watcher_win.h rename to components/storage_monitor/volume_mount_watcher_win.h index 955221a4943c5..5168671b38091 100644 --- a/chrome/browser/storage_monitor/volume_mount_watcher_win.h +++ b/components/storage_monitor/volume_mount_watcher_win.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ -#define CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ +#ifndef COMPONENTS_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ +#define COMPONENTS_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ #include #include @@ -17,8 +17,8 @@ #include "base/sequenced_task_runner.h" #include "base/strings/string16.h" #include "base/threading/sequenced_worker_pool.h" -#include "chrome/browser/storage_monitor/storage_info.h" -#include "chrome/browser/storage_monitor/storage_monitor.h" +#include "components/storage_monitor/storage_info.h" +#include "components/storage_monitor/storage_monitor.h" class TestVolumeMountWatcherWin; @@ -116,4 +116,4 @@ class VolumeMountWatcherWin { DISALLOW_COPY_AND_ASSIGN(VolumeMountWatcherWin); }; -#endif // CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ +#endif // COMPONENTS_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_