diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 00:37:54 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 00:37:54 +0000 |
commit | 95951999533ca1e6d15bc741a3a0885dcf0b1a03 (patch) | |
tree | 98c44c9c303aabcb487e2793a25d2171b06bd05f | |
parent | 31cf1479f372a6aaed29973d9091f8a55b07b884 (diff) | |
download | chromium_src-95951999533ca1e6d15bc741a3a0885dcf0b1a03.zip chromium_src-95951999533ca1e6d15bc741a3a0885dcf0b1a03.tar.gz chromium_src-95951999533ca1e6d15bc741a3a0885dcf0b1a03.tar.bz2 |
Cleanup: Remove chrome namespace for storage monitor and media galleries.
BUG=289619
Review URL: https://chromiumcodereview.appspot.com/23727009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222938 0039d316-1c4b-4281-b951-d872f2087c98
180 files changed, 395 insertions, 1008 deletions
diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index ca828e9..cbad4bc 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h @@ -30,6 +30,7 @@ class GpuModeManager; class IconManager; class IntranetRedirectDetector; class IOThread; +class MediaFileSystemRegistry; class MetricsService; class NotificationUIManager; class PnaclComponentInstaller; @@ -40,16 +41,12 @@ class ProfileManager; class RenderWidgetSnapshotTaker; class SafeBrowsingService; class StatusTray; +class StorageMonitor; class WatchDogThread; #if defined(ENABLE_WEBRTC) class WebRtcLogUploader; #endif -namespace chrome { -class MediaFileSystemRegistry; -class StorageMonitor; -} - namespace chrome_variations { class VariationsService; } @@ -216,9 +213,9 @@ class BrowserProcess { virtual BookmarkPromptController* bookmark_prompt_controller() = 0; - virtual chrome::MediaFileSystemRegistry* media_file_system_registry() = 0; + virtual MediaFileSystemRegistry* media_file_system_registry() = 0; - virtual chrome::StorageMonitor* storage_monitor() = 0; + virtual StorageMonitor* storage_monitor() = 0; virtual bool created_local_state() const = 0; diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 5dd6eda..5c38861 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -622,7 +622,7 @@ BookmarkPromptController* BrowserProcessImpl::bookmark_prompt_controller() { #endif } -chrome::StorageMonitor* BrowserProcessImpl::storage_monitor() { +StorageMonitor* BrowserProcessImpl::storage_monitor() { #if defined(OS_ANDROID) || defined(OS_IOS) return NULL; #else @@ -631,19 +631,18 @@ chrome::StorageMonitor* BrowserProcessImpl::storage_monitor() { } void BrowserProcessImpl::set_storage_monitor_for_test( - scoped_ptr<chrome::StorageMonitor> monitor) { + scoped_ptr<StorageMonitor> monitor) { #if !defined(OS_ANDROID) && !defined(OS_IOS) storage_monitor_ = monitor.Pass(); #endif } -chrome::MediaFileSystemRegistry* -BrowserProcessImpl::media_file_system_registry() { +MediaFileSystemRegistry* BrowserProcessImpl::media_file_system_registry() { #if defined(OS_ANDROID) || defined(OS_IOS) return NULL; #else if (!media_file_system_registry_) - media_file_system_registry_.reset(new chrome::MediaFileSystemRegistry()); + media_file_system_registry_.reset(new MediaFileSystemRegistry()); return media_file_system_registry_.get(); #endif } @@ -928,7 +927,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { #endif #if !defined(OS_ANDROID) && !defined(OS_IOS) - storage_monitor_.reset(chrome::StorageMonitor::Create()); + storage_monitor_.reset(StorageMonitor::Create()); #endif platform_part_->PreMainMessageLoopRun(); diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 728c0d9..f287ff9 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -123,10 +123,9 @@ class BrowserProcessImpl : public BrowserProcess, virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; - virtual chrome::StorageMonitor* storage_monitor() OVERRIDE; - void set_storage_monitor_for_test(scoped_ptr<chrome::StorageMonitor> monitor); - virtual chrome::MediaFileSystemRegistry* - media_file_system_registry() OVERRIDE; + virtual StorageMonitor* storage_monitor() OVERRIDE; + void set_storage_monitor_for_test(scoped_ptr<StorageMonitor> monitor); + virtual MediaFileSystemRegistry* media_file_system_registry() OVERRIDE; virtual bool created_local_state() const OVERRIDE; #if defined(ENABLE_WEBRTC) virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE; @@ -197,9 +196,9 @@ class BrowserProcessImpl : public BrowserProcess, #endif #if !defined(OS_ANDROID) && !defined(OS_IOS) - scoped_ptr<chrome::StorageMonitor> storage_monitor_; + scoped_ptr<StorageMonitor> storage_monitor_; - scoped_ptr<chrome::MediaFileSystemRegistry> media_file_system_registry_; + scoped_ptr<MediaFileSystemRegistry> media_file_system_registry_; #endif scoped_refptr<printing::PrintPreviewDialogController> diff --git a/chrome/browser/chromeos/camera_detector.cc b/chrome/browser/chromeos/camera_detector.cc index f790667..b5493ed 100644 --- a/chrome/browser/chromeos/camera_detector.cc +++ b/chrome/browser/chromeos/camera_detector.cc @@ -73,7 +73,7 @@ bool CameraDetector::CheckPresence() { for (base::FilePath path = file_enum.Next(); !path.empty(); path = file_enum.Next()) { std::string v4l_capabilities; - if (chrome::GetUdevDevicePropertyValueByPath( + if (GetUdevDevicePropertyValueByPath( path, kV4LCapabilities, &v4l_capabilities)) { std::vector<std::string> caps; base::SplitString(v4l_capabilities, kV4LCapabilitiesDelim, &caps); 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 cc5fe09..ae73a0d 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc @@ -39,9 +39,6 @@ #endif using apps::ShellWindow; -using chrome::MediaFileSystemInfo; -using chrome::MediaFileSystemRegistry; -using chrome::MediaFileSystemsCallback; using content::ChildProcessSecurityPolicy; using content::WebContents; using web_modal::WebContentsModalDialogManager; @@ -93,7 +90,7 @@ bool MediaGalleriesGetMediaFileSystemsFunction::RunImpl() { interactive = params->details->interactive; } - chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( + StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( &MediaGalleriesGetMediaFileSystemsFunction::OnStorageMonitorInit, this, interactive)); @@ -228,17 +225,17 @@ void MediaGalleriesGetMediaFileSystemsFunction::ShowDialog() { // Controller will delete itself. base::Closure cb = base::Bind( &MediaGalleriesGetMediaFileSystemsFunction::GetAndReturnGalleries, this); - new chrome::MediaGalleriesDialogController(contents, *GetExtension(), cb); + new MediaGalleriesDialogController(contents, *GetExtension(), cb); } void MediaGalleriesGetMediaFileSystemsFunction::GetMediaFileSystemsForExtension( - const chrome::MediaFileSystemsCallback& cb) { + const MediaFileSystemsCallback& cb) { if (!render_view_host()) { cb.Run(std::vector<MediaFileSystemInfo>()); return; } - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); MediaFileSystemRegistry* registry = g_browser_process->media_file_system_registry(); registry->GetMediaFileSystemsForExtension( 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 ededafa..ac0cd5e 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.h +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.h @@ -34,28 +34,25 @@ class MediaGalleriesGetMediaFileSystemsFunction MediaGalleries::GetMediaFileSystemsInteractivity interactive); // Always show the dialog. - void AlwaysShowDialog( - const std::vector<chrome::MediaFileSystemInfo>& filesystems); + void AlwaysShowDialog(const std::vector<MediaFileSystemInfo>& filesystems); // If no galleries are found, show the dialog, otherwise return them. void ShowDialogIfNoGalleries( - const std::vector<chrome::MediaFileSystemInfo>& filesystems); + const std::vector<MediaFileSystemInfo>& filesystems); // Grabs galleries from the media file system registry and passes them to // |ReturnGalleries|. void GetAndReturnGalleries(); // Returns galleries to the caller. - void ReturnGalleries( - const std::vector<chrome::MediaFileSystemInfo>& filesystems); + void ReturnGalleries(const std::vector<MediaFileSystemInfo>& filesystems); // Shows the configuration dialog to edit gallery preferences. void ShowDialog(); // A helper method that calls // MediaFileSystemRegistry::GetMediaFileSystemsForExtension(). - void GetMediaFileSystemsForExtension( - const chrome::MediaFileSystemsCallback& cb); + void GetMediaFileSystemsForExtension(const MediaFileSystemsCallback& cb); }; } // namespace extensions 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 73aaeb4..8d8b341 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc @@ -44,14 +44,13 @@ const char kTestGalleries[] = "testGalleries(%d)"; // testing platforms with no default media galleries, such as CHROMEOS. void MakeFakeMediaGalleryForTest(Profile* profile, const base::FilePath& path) { base::RunLoop runloop; - chrome::StorageMonitor::GetInstance()->EnsureInitialized( - runloop.QuitClosure()); + StorageMonitor::GetInstance()->EnsureInitialized(runloop.QuitClosure()); runloop.Run(); - chrome::MediaGalleriesPreferences* preferences = + MediaGalleriesPreferences* preferences = g_browser_process->media_file_system_registry()->GetPreferences(profile); - chrome::MediaGalleryPrefInfo gallery_info; + MediaGalleryPrefInfo gallery_info; ASSERT_FALSE(preferences->LookUpGalleryByPath(path, &gallery_info)); preferences->AddGallery(gallery_info.device_id, gallery_info.path, @@ -82,19 +81,17 @@ class MediaGalleriesPlatformAppBrowserTest : public PlatformAppBrowserTest { } void AttachFakeDevice() { - device_id_ = chrome::StorageInfo::MakeDeviceId( - chrome::StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); + device_id_ = StorageInfo::MakeDeviceId( + StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); - chrome::StorageMonitor::GetInstance()->receiver()->ProcessAttach( - chrome::StorageInfo(device_id_, string16(), kDevicePath, - ASCIIToUTF16(kDeviceName), - string16(), string16(), 0)); + StorageMonitor::GetInstance()->receiver()->ProcessAttach( + StorageInfo(device_id_, string16(), kDevicePath, + ASCIIToUTF16(kDeviceName), string16(), string16(), 0)); content::RunAllPendingInMessageLoop(); } void DetachFakeDevice() { - chrome::StorageMonitor::GetInstance()->receiver()->ProcessDetach( - device_id_); + StorageMonitor::GetInstance()->receiver()->ProcessDetach(device_id_); content::RunAllPendingInMessageLoop(); } @@ -104,7 +101,7 @@ class MediaGalleriesPlatformAppBrowserTest : public PlatformAppBrowserTest { IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, MediaGalleriesNoAccess) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/no_access")) << message_; RunSecondTestPhase(base::UTF8ToUTF16(base::StringPrintf( @@ -112,21 +109,21 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, } IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, NoGalleriesRead) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/no_galleries")) << message_; } IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, NoGalleriesCopyTo) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; ASSERT_TRUE(RunPlatformAppTest( "api_test/media_galleries/no_galleries_copy_to")) << message_; } IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, MediaGalleriesRead) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/read_access")) << message_; RunSecondTestPhase(base::UTF8ToUTF16(base::StringPrintf( @@ -135,7 +132,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, MediaGalleriesCopyTo) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); MakeFakeMediaGalleryForTest(browser()->profile(), temp_dir.path()); @@ -145,7 +142,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, MediaGalleriesCopyToNoAccess) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); MakeFakeMediaGalleryForTest(browser()->profile(), temp_dir.path()); @@ -156,7 +153,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, MediaGalleriesAccessAttached) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; AttachFakeDevice(); @@ -172,7 +169,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, GetFilesystemMetadata) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/metadata")) << message_; } diff --git a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.cc b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.cc index c12d9d7..2da647a 100644 --- a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.cc +++ b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.cc @@ -36,7 +36,7 @@ WatchManagerMap* g_gallery_watch_managers = NULL; // Dispatches the gallery changed event on the UI thread. void SendGalleryChangedEventOnUIThread( base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const std::set<std::string>& extension_ids) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (event_router.get()) @@ -60,7 +60,7 @@ class GalleryWatchManager::GalleryFilePathWatcher // reference goes away. GalleryFilePathWatcher( base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const base::FilePath& path, const std::string& extension_id, const base::Closure& on_destroyed_callback); @@ -104,7 +104,7 @@ class GalleryWatchManager::GalleryFilePathWatcher base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router_; // The gallery identifier, e.g "1". - chrome::MediaGalleryPrefId gallery_id_; + MediaGalleryPrefId gallery_id_; // The gallery file path watcher. base::FilePathWatcher file_watcher_; @@ -126,7 +126,7 @@ class GalleryWatchManager::GalleryFilePathWatcher GalleryWatchManager::GalleryFilePathWatcher::GalleryFilePathWatcher( base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const base::FilePath& path, const std::string& extension_id, const base::Closure& on_destroyed_callback) @@ -276,7 +276,7 @@ void GalleryWatchManager::OnProfileShutdown(void* profile_id) { // static bool GalleryWatchManager::SetupGalleryWatch( void* profile_id, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const base::FilePath& watch_path, const std::string& extension_id, base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router) { @@ -315,7 +315,7 @@ GalleryWatchManager::~GalleryWatchManager() { } bool GalleryWatchManager::StartGalleryWatch( - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const base::FilePath& watch_path, const std::string& extension_id, base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router) { diff --git a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.h b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.h index 0239510..cba3e20 100644 --- a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.h +++ b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.h @@ -41,7 +41,7 @@ class GalleryWatchManager { // Returns true, if the watch setup operation was successful. static bool SetupGalleryWatch( void* profile_id, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const base::FilePath& watch_path, const std::string& extension_id, base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router); @@ -70,7 +70,7 @@ class GalleryWatchManager { // |watch_path| specifies the absolute path of the gallery. Returns true, // if the watch was set successfully. bool StartGalleryWatch( - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const base::FilePath& watch_path, const std::string& extension_id, base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router); diff --git a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.cc b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.cc index 3455232..e6d4598 100644 --- a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.cc +++ b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.cc @@ -36,15 +36,15 @@ namespace { const char kRegisteredGalleryWatchers[] = "media_gallery_watchers"; // Converts the storage |list| value to WatchedGalleryIds. -chrome::MediaGalleryPrefIdSet WatchedGalleryIdsFromValue( +MediaGalleryPrefIdSet WatchedGalleryIdsFromValue( const base::ListValue* list) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - chrome::MediaGalleryPrefIdSet gallery_ids; + MediaGalleryPrefIdSet gallery_ids; std::string gallery_id_str; for (size_t i = 0; i < list->GetSize(); ++i) { if (!list->GetString(i, &gallery_id_str) || gallery_id_str.empty()) continue; - chrome::MediaGalleryPrefId gallery_id; + MediaGalleryPrefId gallery_id; if (base::StringToUint64(gallery_id_str, &gallery_id)) gallery_ids.insert(gallery_id); } @@ -53,11 +53,10 @@ chrome::MediaGalleryPrefIdSet WatchedGalleryIdsFromValue( // Converts WatchedGalleryIds to a storage list value. scoped_ptr<base::ListValue> WatchedGalleryIdsToValue( - const chrome::MediaGalleryPrefIdSet gallery_ids) { + const MediaGalleryPrefIdSet gallery_ids) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); scoped_ptr<base::ListValue> list(new base::ListValue()); - for (chrome::MediaGalleryPrefIdSet::const_iterator id_iter = - gallery_ids.begin(); + for (MediaGalleryPrefIdSet::const_iterator id_iter = gallery_ids.begin(); id_iter != gallery_ids.end(); ++id_iter) list->AppendString(base::Uint64ToString(*id_iter)); return list.Pass(); @@ -82,7 +81,7 @@ GalleryWatchStateTracker::GalleryWatchStateTracker(Profile* profile) content::Source<Profile>(profile_)); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, content::Source<Profile>(profile_)); - chrome::MediaGalleriesPreferences* preferences = + MediaGalleriesPreferences* preferences = g_browser_process->media_file_system_registry()->GetPreferences( profile); preferences->AddGalleryChangeObserver(this); @@ -90,7 +89,7 @@ GalleryWatchStateTracker::GalleryWatchStateTracker(Profile* profile) GalleryWatchStateTracker::~GalleryWatchStateTracker() { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - chrome::MediaGalleriesPreferences* preferences = + MediaGalleriesPreferences* preferences = g_browser_process->media_file_system_registry()->GetPreferences( profile_); preferences->RemoveGalleryChangeObserver(this); @@ -114,9 +113,9 @@ GalleryWatchStateTracker* GalleryWatchStateTracker::GetForProfile( } void GalleryWatchStateTracker::OnGalleryChanged( - chrome::MediaGalleriesPreferences* preferences, + MediaGalleriesPreferences* preferences, const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, bool has_permission) { if (extension_id.empty()) return; @@ -132,10 +131,10 @@ void GalleryWatchStateTracker::OnGalleryChanged( RemoveGalleryWatch(extension_id, gallery_id, preferences); } -chrome::MediaGalleryPrefIdSet +MediaGalleryPrefIdSet GalleryWatchStateTracker::GetAllWatchedGalleryIDsForExtension( const std::string& extension_id) const { - chrome::MediaGalleryPrefIdSet gallery_ids; + MediaGalleryPrefIdSet gallery_ids; WatchedExtensionsMap::const_iterator extension_id_iter = watched_extensions_map_.find(extension_id); if (extension_id_iter != watched_extensions_map_.end()) { @@ -151,7 +150,7 @@ GalleryWatchStateTracker::GetAllWatchedGalleryIDsForExtension( void GalleryWatchStateTracker::RemoveAllGalleryWatchersForExtension( const std::string& extension_id, - chrome::MediaGalleriesPreferences* preferences) { + MediaGalleriesPreferences* preferences) { WatchedExtensionsMap::iterator extension_id_iter = watched_extensions_map_.find(extension_id); if (extension_id_iter == watched_extensions_map_.end()) @@ -166,7 +165,7 @@ void GalleryWatchStateTracker::RemoveAllGalleryWatchersForExtension( void GalleryWatchStateTracker::OnGalleryWatchAdded( const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id) { + MediaGalleryPrefId gallery_id) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); bool update_storage = AddWatchedGalleryIdInfoForExtension(extension_id, gallery_id); @@ -176,7 +175,7 @@ void GalleryWatchStateTracker::OnGalleryWatchAdded( void GalleryWatchStateTracker::OnGalleryWatchRemoved( const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id) { + MediaGalleryPrefId gallery_id) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); if (!ContainsKey(watched_extensions_map_, extension_id)) return; @@ -235,7 +234,7 @@ void GalleryWatchStateTracker::WriteToStorage(const std::string& extension_id) { StateStore* storage = ExtensionSystem::Get(profile_)->state_store(); if (!storage) return; - chrome::MediaGalleryPrefIdSet gallery_ids = + MediaGalleryPrefIdSet gallery_ids = GetAllWatchedGalleryIDsForExtension(extension_id); storage->SetExtensionValue( extension_id, @@ -247,17 +246,16 @@ void GalleryWatchStateTracker::ReadFromStorage( const std::string& extension_id, scoped_ptr<base::Value> value) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - chrome::MediaGalleriesPreferences* preferences = + MediaGalleriesPreferences* preferences = g_browser_process->media_file_system_registry()->GetPreferences(profile_); base::ListValue* list = NULL; if (!value.get() || !value->GetAsList(&list)) return; - chrome::MediaGalleryPrefIdSet gallery_ids = WatchedGalleryIdsFromValue(list); + MediaGalleryPrefIdSet gallery_ids = WatchedGalleryIdsFromValue(list); if (gallery_ids.empty()) return; - for (chrome::MediaGalleryPrefIdSet::const_iterator id_iter = - gallery_ids.begin(); + for (MediaGalleryPrefIdSet::const_iterator id_iter = gallery_ids.begin(); id_iter != gallery_ids.end(); ++id_iter) { watched_extensions_map_[extension_id][*id_iter] = false; SetupGalleryWatch(extension_id, *id_iter, preferences); @@ -266,8 +264,8 @@ void GalleryWatchStateTracker::ReadFromStorage( void GalleryWatchStateTracker::SetupGalleryWatch( const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, - chrome::MediaGalleriesPreferences* preferences) { + MediaGalleryPrefId gallery_id, + MediaGalleriesPreferences* preferences) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); const Extension* extension = GetExtensionById(profile_, extension_id); DCHECK(extension); @@ -295,8 +293,8 @@ void GalleryWatchStateTracker::SetupGalleryWatch( void GalleryWatchStateTracker::RemoveGalleryWatch( const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, - chrome::MediaGalleriesPreferences* preferences) { + MediaGalleryPrefId gallery_id, + MediaGalleriesPreferences* preferences) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); const Extension* extension = GetExtensionById(profile_, extension_id); DCHECK(extension); @@ -315,7 +313,7 @@ void GalleryWatchStateTracker::RemoveGalleryWatch( bool GalleryWatchStateTracker::HasGalleryWatchInfo( const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, bool has_active_watcher) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); return (ContainsKey(watched_extensions_map_, extension_id) && @@ -326,7 +324,7 @@ bool GalleryWatchStateTracker::HasGalleryWatchInfo( void GalleryWatchStateTracker::HandleSetupGalleryWatchResponse( const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, bool success) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); if (!success) @@ -336,7 +334,7 @@ void GalleryWatchStateTracker::HandleSetupGalleryWatchResponse( bool GalleryWatchStateTracker::AddWatchedGalleryIdInfoForExtension( const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id) { + MediaGalleryPrefId gallery_id) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); if (HasGalleryWatchInfo(extension_id, gallery_id, true)) return false; diff --git a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h index d59648d..df011ea 100644 --- a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h +++ b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h @@ -32,7 +32,7 @@ namespace extensions { class GalleryWatchStateTracker : public content::NotificationObserver, public base::SupportsWeakPtr<GalleryWatchStateTracker>, - public chrome::MediaGalleriesPreferences::GalleryChangeObserver { + public MediaGalleriesPreferences::GalleryChangeObserver { public: explicit GalleryWatchStateTracker(Profile* profile); virtual ~GalleryWatchStateTracker(); @@ -44,12 +44,12 @@ class GalleryWatchStateTracker // Updates the storage for the given extension on the receipt of gallery // watch added event. void OnGalleryWatchAdded(const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id); + MediaGalleryPrefId gallery_id); // Updates the storage for the given extension on the receipt of gallery // watch removed event. void OnGalleryWatchRemoved(const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id); + MediaGalleryPrefId gallery_id); // Updates the state of the gallery watchers on the receipt of access // permission changed event for the extension specified by the |extension_id|. @@ -58,29 +58,28 @@ class GalleryWatchStateTracker // |has_permission| is set to true if the user granted permission to // access the gallery associated with the |gallery_id| and is set to false // if the user revoked the gallery permission. - virtual void OnGalleryChanged( - chrome::MediaGalleriesPreferences* pref, - const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, - bool has_permission) OVERRIDE; + virtual void OnGalleryChanged(MediaGalleriesPreferences* pref, + const std::string& extension_id, + MediaGalleryPrefId gallery_id, + bool has_permission) OVERRIDE; // Returns a set of watched gallery identifiers for the extension specified // by the |extension_id|. - chrome::MediaGalleryPrefIdSet GetAllWatchedGalleryIDsForExtension( + MediaGalleryPrefIdSet GetAllWatchedGalleryIDsForExtension( const std::string& extension_id) const; // Removes all the gallery watchers associated with the extension specified // by the |extension_id|. void RemoveAllGalleryWatchersForExtension( const std::string& extension_id, - chrome::MediaGalleriesPreferences* preferences); + MediaGalleriesPreferences* preferences); private: // Key: Gallery identifier. // Value: True if the watcher is active. Watcher will be active only if // the extension has access permission to the watched gallery and a watcher // has been successfully setup. - typedef std::map<chrome::MediaGalleryPrefId, bool> WatchedGalleriesMap; + typedef std::map<MediaGalleryPrefId, bool> WatchedGalleriesMap; // Key: Extension identifier. // Value: Map of watched gallery information. @@ -100,35 +99,34 @@ class GalleryWatchStateTracker // Sets up the gallery watcher on the receipt of granted gallery permission // event. void SetupGalleryWatch(const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, - chrome::MediaGalleriesPreferences* preferences); + MediaGalleryPrefId gallery_id, + MediaGalleriesPreferences* preferences); // Removes the gallery watcher on the receipt of revoked gallery permission // event. void RemoveGalleryWatch(const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, - chrome::MediaGalleriesPreferences* preferences); + MediaGalleryPrefId gallery_id, + MediaGalleriesPreferences* preferences); // Returns true if a gallery watcher exists for the extension. // Set |has_active_watcher| to true to find if the gallery watcher is active. bool HasGalleryWatchInfo(const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, bool has_active_watcher); // Handles the setup gallery watch request response. When an extension is // loaded, GalleryWatchStateTracker reads the storage and sends request to // setup gallery watchers for the known watch paths. void HandleSetupGalleryWatchResponse(const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, bool success); // Adds the watched |gallery_id| in |watched_extensions_map_| for the // extension specified by the |extension_id|. Returns true if the |gallery_id| // is added into the |watched_extensions_map_| and returns false if the // |gallery_id| already exists in the |watched_extensions_map_|. - bool AddWatchedGalleryIdInfoForExtension( - const std::string& extension_id, - chrome::MediaGalleryPrefId gallery_id); + bool AddWatchedGalleryIdInfoForExtension(const std::string& extension_id, + MediaGalleryPrefId gallery_id); // Current profile. Profile* profile_; 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 eb503a8..564908a 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 @@ -59,11 +59,11 @@ bool GetGalleryFilePathAndId(const std::string& gallery_id, Profile* profile, const Extension* extension, base::FilePath* gallery_file_path, - chrome::MediaGalleryPrefId* gallery_pref_id) { - chrome::MediaGalleryPrefId pref_id; + MediaGalleryPrefId* gallery_pref_id) { + MediaGalleryPrefId pref_id; if (!base::StringToUint64(gallery_id, &pref_id)) return false; - chrome::MediaFileSystemRegistry* registry = + MediaFileSystemRegistry* registry = g_browser_process->media_file_system_registry(); base::FilePath file_path( registry->GetPreferences(profile)->LookUpGalleryPathForExtension( @@ -127,7 +127,7 @@ void MediaGalleriesPrivateAPI::OnListenerAdded( // This method is called synchronously with the message handler for the // JS invocation. - chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( + StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( &MediaGalleriesPrivateAPI::MaybeInitializeEventRouterAndTracker, weak_ptr_factory_.GetWeakPtr())); } @@ -148,7 +148,7 @@ void MediaGalleriesPrivateAPI::MaybeInitializeEventRouterAndTracker() { return; media_galleries_private_event_router_.reset( new MediaGalleriesPrivateEventRouter(profile_)); - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); tracker_.reset( new GalleryWatchStateTracker(profile_)); } @@ -170,7 +170,7 @@ bool MediaGalleriesPrivateAddGalleryWatchFunction::RunImpl() { AddGalleryWatch::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); - chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( + StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( &MediaGalleriesPrivateAddGalleryWatchFunction::OnStorageMonitorInit, this, params->gallery_id)); @@ -180,9 +180,9 @@ bool MediaGalleriesPrivateAddGalleryWatchFunction::RunImpl() { void MediaGalleriesPrivateAddGalleryWatchFunction::OnStorageMonitorInit( const std::string& pref_id) { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); base::FilePath gallery_file_path; - chrome::MediaGalleryPrefId gallery_pref_id = 0; + MediaGalleryPrefId gallery_pref_id = 0; if (!GetGalleryFilePathAndId(pref_id, profile_, GetExtension(), &gallery_file_path, &gallery_pref_id)) { error_ = kInvalidGalleryIDError; @@ -214,7 +214,7 @@ void MediaGalleriesPrivateAddGalleryWatchFunction::OnStorageMonitorInit( } void MediaGalleriesPrivateAddGalleryWatchFunction::HandleResponse( - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, bool success) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); media_galleries_private::AddGalleryWatchResult result; @@ -222,7 +222,7 @@ void MediaGalleriesPrivateAddGalleryWatchFunction::HandleResponse( result.success = success; SetResult(result.ToValue().release()); if (success) { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); GalleryWatchStateTracker* state_tracker = MediaGalleriesPrivateAPI::Get(profile_)->GetGalleryWatchStateTracker(); state_tracker->OnGalleryWatchAdded(extension_id(), gallery_id); @@ -250,7 +250,7 @@ bool MediaGalleriesPrivateRemoveGalleryWatchFunction::RunImpl() { RemoveGalleryWatch::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); - chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( + StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( &MediaGalleriesPrivateRemoveGalleryWatchFunction::OnStorageMonitorInit, this, params->gallery_id)); @@ -259,10 +259,10 @@ bool MediaGalleriesPrivateRemoveGalleryWatchFunction::RunImpl() { void MediaGalleriesPrivateRemoveGalleryWatchFunction::OnStorageMonitorInit( const std::string& pref_id) { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); #if defined(OS_WIN) base::FilePath gallery_file_path; - chrome::MediaGalleryPrefId gallery_pref_id = 0; + MediaGalleryPrefId gallery_pref_id = 0; if (!GetGalleryFilePathAndId(pref_id, profile_, GetExtension(), &gallery_file_path, &gallery_pref_id)) { error_ = kInvalidGalleryIDError; @@ -297,7 +297,7 @@ bool MediaGalleriesPrivateGetAllGalleryWatchFunction::RunImpl() { if (!render_view_host() || !render_view_host()->GetProcess()) return false; - chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( + StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( &MediaGalleriesPrivateGetAllGalleryWatchFunction::OnStorageMonitorInit, this)); return true; @@ -306,13 +306,12 @@ bool MediaGalleriesPrivateGetAllGalleryWatchFunction::RunImpl() { void MediaGalleriesPrivateGetAllGalleryWatchFunction::OnStorageMonitorInit() { std::vector<std::string> result; #if defined(OS_WIN) - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); GalleryWatchStateTracker* state_tracker = MediaGalleriesPrivateAPI::Get(profile_)->GetGalleryWatchStateTracker(); - chrome::MediaGalleryPrefIdSet gallery_ids = + MediaGalleryPrefIdSet gallery_ids = state_tracker->GetAllWatchedGalleryIDsForExtension(extension_id()); - for (chrome::MediaGalleryPrefIdSet::const_iterator iter = - gallery_ids.begin(); + for (MediaGalleryPrefIdSet::const_iterator iter = gallery_ids.begin(); iter != gallery_ids.end(); ++iter) { result.push_back(base::Uint64ToString(*iter)); } @@ -334,7 +333,7 @@ bool MediaGalleriesPrivateRemoveAllGalleryWatchFunction::RunImpl() { if (!render_view_host() || !render_view_host()->GetProcess()) return false; - chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( + StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( &MediaGalleriesPrivateRemoveAllGalleryWatchFunction::OnStorageMonitorInit, this)); return true; @@ -343,11 +342,10 @@ bool MediaGalleriesPrivateRemoveAllGalleryWatchFunction::RunImpl() { void MediaGalleriesPrivateRemoveAllGalleryWatchFunction::OnStorageMonitorInit() { #if defined(OS_WIN) - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::MediaFileSystemRegistry* registry = + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + MediaFileSystemRegistry* registry = g_browser_process->media_file_system_registry(); - chrome::MediaGalleriesPreferences* preferences = - registry->GetPreferences(profile_); + MediaGalleriesPreferences* preferences = registry->GetPreferences(profile_); GalleryWatchStateTracker* state_tracker = MediaGalleriesPrivateAPI::Get(profile_)->GetGalleryWatchStateTracker(); state_tracker->RemoveAllGalleryWatchersForExtension( diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h index d2165b5..ce66e07 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h @@ -89,8 +89,7 @@ class MediaGalleriesPrivateAddGalleryWatchFunction void OnStorageMonitorInit(const std::string& pref_id); // Gallery watch request handler. - void HandleResponse(chrome::MediaGalleryPrefId gallery_id, - bool success); + void HandleResponse(MediaGalleryPrefId gallery_id, bool success); }; // Implements the chrome.mediaGalleriesPrivate.removeGalleryWatch method. 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 df662f0..aa2a715 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 @@ -60,8 +60,8 @@ class MediaGalleriesPrivateApiTest : public ExtensionApiTest { // ExtensionApiTest overrides. virtual void SetUp() OVERRIDE { - device_id_ = chrome::StorageInfo::MakeDeviceId( - chrome::StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); + device_id_ = StorageInfo::MakeDeviceId( + StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); ExtensionApiTest::SetUp(); } @@ -87,17 +87,16 @@ class MediaGalleriesPrivateApiTest : public ExtensionApiTest { } void Attach() { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::StorageInfo info(device_id_, ASCIIToUTF16(kDeviceName), kDevicePath, - string16(), string16(), string16(), 0); - chrome::StorageMonitor::GetInstance()->receiver()->ProcessAttach(info); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + StorageInfo info(device_id_, ASCIIToUTF16(kDeviceName), kDevicePath, + string16(), string16(), string16(), 0); + StorageMonitor::GetInstance()->receiver()->ProcessAttach(info); content::RunAllPendingInMessageLoop(); } void Detach() { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::StorageMonitor::GetInstance()->receiver()->ProcessDetach( - device_id_); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + StorageMonitor::GetInstance()->receiver()->ProcessDetach(device_id_); content::RunAllPendingInMessageLoop(); } @@ -109,7 +108,7 @@ class MediaGalleriesPrivateApiTest : public ExtensionApiTest { IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateApiTest, DeviceAttachDetachEvents) { // Setup. - chrome::test::TestStorageMonitor::SyncInitialize(); + TestStorageMonitor::SyncInitialize(); const extensions::Extension* extension = LoadExtension(test_data_dir_.AppendASCII(kTestExtensionPath)); ASSERT_TRUE(extension); 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 8f0baf3..1d8b428 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 @@ -25,7 +25,7 @@ namespace extensions { namespace { std::string GetTransientIdForDeviceId(const std::string& device_id) { - chrome::StorageMonitor* monitor = chrome::StorageMonitor::GetInstance(); + StorageMonitor* monitor = StorageMonitor::GetInstance(); return monitor->GetTransientIdForDeviceId(device_id); } @@ -40,19 +40,19 @@ MediaGalleriesPrivateEventRouter::MediaGalleriesPrivateEventRouter( : profile_(profile) { DCHECK(profile_); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - chrome::StorageMonitor::GetInstance()->AddObserver(this); + StorageMonitor::GetInstance()->AddObserver(this); } MediaGalleriesPrivateEventRouter::~MediaGalleriesPrivateEventRouter() { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); // TODO(gbillock): Remove this check once we have destruction order // fixed up for profile services and the storage monitor. - if (chrome::StorageMonitor::GetInstance()) - chrome::StorageMonitor::GetInstance()->RemoveObserver(this); + if (StorageMonitor::GetInstance()) + StorageMonitor::GetInstance()->RemoveObserver(this); } void MediaGalleriesPrivateEventRouter::OnGalleryChanged( - chrome::MediaGalleryPrefId gallery_id, + MediaGalleryPrefId gallery_id, const std::set<std::string>& extension_ids) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); EventRouter* router = @@ -82,7 +82,7 @@ void MediaGalleriesPrivateEventRouter::OnGalleryChanged( } void MediaGalleriesPrivateEventRouter::OnRemovableStorageAttached( - const chrome::StorageInfo& info) { + const StorageInfo& info) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); EventRouter* router = extensions::ExtensionSystem::Get(profile_)->event_router(); @@ -90,10 +90,10 @@ void MediaGalleriesPrivateEventRouter::OnRemovableStorageAttached( media_galleries_private::OnDeviceAttached::kEventName)) return; - chrome::MediaGalleryPrefInfo pref_info; + MediaGalleryPrefInfo pref_info; pref_info.display_name = info.name(); pref_info.device_id = info.device_id(); - pref_info.type = chrome::MediaGalleryPrefInfo::kAutoDetected; + pref_info.type = MediaGalleryPrefInfo::kAutoDetected; pref_info.volume_label = info.storage_label(); pref_info.vendor_name = info.vendor_name(); pref_info.model_name = info.model_name(); @@ -111,7 +111,7 @@ void MediaGalleriesPrivateEventRouter::OnRemovableStorageAttached( } void MediaGalleriesPrivateEventRouter::OnRemovableStorageDetached( - const chrome::StorageInfo& info) { + const StorageInfo& info) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); EventRouter* router = extensions::ExtensionSystem::Get(profile_)->event_router(); 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 d4ef969..1915400 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 @@ -28,22 +28,20 @@ class ListValue; namespace extensions { class MediaGalleriesPrivateEventRouter - : public chrome::RemovableStorageObserver, + : public RemovableStorageObserver, public base::SupportsWeakPtr<MediaGalleriesPrivateEventRouter> { public: explicit MediaGalleriesPrivateEventRouter(Profile* profile); virtual ~MediaGalleriesPrivateEventRouter(); // Gallery changed event handler. - void OnGalleryChanged(chrome::MediaGalleryPrefId gallery_id, + void OnGalleryChanged(MediaGalleryPrefId gallery_id, const std::set<std::string>& extension_ids); private: // RemovableStorageObserver implementation. - virtual void OnRemovableStorageAttached( - const chrome::StorageInfo& info) OVERRIDE; - virtual void OnRemovableStorageDetached( - const chrome::StorageInfo& info) OVERRIDE; + virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE; + virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE; void DispatchEvent(const std::string& event_name, scoped_ptr<base::ListValue> event_args); diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc index c0de464..6a2c75d 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc @@ -125,7 +125,7 @@ class MediaGalleriesPrivateGalleryWatchApiTest : public ExtensionApiTest { #if defined(OS_WIN) IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, BasicGalleryWatch) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); @@ -173,7 +173,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, RemoveListenerAndModifyGallery) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); @@ -213,7 +213,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, SetupGalleryWatchWithoutListeners) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); @@ -239,7 +239,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, SetupGalleryChangedListenerWithoutWatchers) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); @@ -280,7 +280,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, GetAllGalleryWatch) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); @@ -330,7 +330,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, RemoveAllGalleryWatch) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); @@ -375,7 +375,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, // Please refer to crbug.com/144491. IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, SetupGalleryWatch) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); @@ -399,7 +399,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, // Please refer to crbug.com/144491. IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest, GetAllGalleryWatch) { - chrome::EnsureMediaDirectoriesExists media_directories; + EnsureMediaDirectoriesExists media_directories; content::RenderViewHost* host = GetBackgroundHostForTestExtension(); ASSERT_TRUE(host); 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 fd0dcaf2..fc298906 100644 --- a/chrome/browser/extensions/api/system_info/system_info_api.cc +++ b/chrome/browser/extensions/api/system_info/system_info_api.cc @@ -44,7 +44,7 @@ bool IsDisplayChangedEvent(const std::string& event_name) { // Event router for systemInfo API. It is a singleton instance shared by // multiple profiles. class SystemInfoEventRouter : public gfx::DisplayObserver, - public chrome::RemovableStorageObserver { + public RemovableStorageObserver { public: static SystemInfoEventRouter* GetInstance(); @@ -61,11 +61,9 @@ class SystemInfoEventRouter : public gfx::DisplayObserver, virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; - // chrome::RemovableStorageObserver implementation. - virtual void OnRemovableStorageAttached( - const chrome::StorageInfo& info) OVERRIDE; - virtual void OnRemovableStorageDetached( - const chrome::StorageInfo& info) OVERRIDE; + // RemovableStorageObserver implementation. + virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE; + virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE; // Called from any thread to dispatch the systemInfo event to all extension // processes cross multiple profiles. @@ -90,12 +88,11 @@ SystemInfoEventRouter* SystemInfoEventRouter::GetInstance() { } SystemInfoEventRouter::SystemInfoEventRouter() { - chrome::StorageMonitor::GetInstance()->AddObserver(this); + StorageMonitor::GetInstance()->AddObserver(this); } SystemInfoEventRouter::~SystemInfoEventRouter() { - if (chrome::StorageMonitor* storage_monitor = - chrome::StorageMonitor::GetInstance()) + if (StorageMonitor* storage_monitor = StorageMonitor::GetInstance()) storage_monitor->RemoveObserver(this); } @@ -134,7 +131,7 @@ void SystemInfoEventRouter::RemoveEventListener( } void SystemInfoEventRouter::OnRemovableStorageAttached( - const chrome::StorageInfo& info) { + const StorageInfo& info) { StorageUnitInfo unit; systeminfo::BuildStorageUnitInfo(info, &unit); scoped_ptr<base::ListValue> args(new base::ListValue); @@ -143,9 +140,9 @@ void SystemInfoEventRouter::OnRemovableStorageAttached( } void SystemInfoEventRouter::OnRemovableStorageDetached( - const chrome::StorageInfo& info) { + const StorageInfo& info) { scoped_ptr<base::ListValue> args(new base::ListValue); - args->Append(new base::StringValue(chrome::StorageMonitor::GetInstance()-> + args->Append(new base::StringValue(StorageMonitor::GetInstance()-> GetTransientIdForDeviceId(info.device_id()))); DispatchEvent(system_storage::OnDetached::kEventName, args.Pass()); diff --git a/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc b/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc index b5b6c98..3a66314 100644 --- a/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc +++ b/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc @@ -13,9 +13,9 @@ const struct TestStorageUnitInfo kRemovableStorageData = { "dcim:device:001", "/media/usb1", 4098, 1000 }; -chrome::StorageInfo BuildStorageInfoFromTestStorageUnitInfo( +StorageInfo BuildStorageInfoFromTestStorageUnitInfo( const TestStorageUnitInfo& unit) { - return chrome::StorageInfo( + return StorageInfo( unit.device_id, UTF8ToUTF16(unit.name), base::FilePath::StringType(), /* no location */ 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 d47aee8..6bdfc0e 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 @@ -24,7 +24,7 @@ struct TestStorageUnitInfo { extern const struct TestStorageUnitInfo kRemovableStorageData; -chrome::StorageInfo BuildStorageInfoFromTestStorageUnitInfo( +StorageInfo BuildStorageInfoFromTestStorageUnitInfo( const TestStorageUnitInfo& unit); } // 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 fd4208b..0c1abf1 100644 --- a/chrome/browser/extensions/api/system_storage/storage_info_provider.cc +++ b/chrome/browser/extensions/api/system_storage/storage_info_provider.cc @@ -14,20 +14,19 @@ namespace extensions { using content::BrowserThread; -using chrome::StorageMonitor; using api::system_storage::StorageUnitInfo; using api::system_storage::STORAGE_UNIT_TYPE_FIXED; using api::system_storage::STORAGE_UNIT_TYPE_REMOVABLE; namespace systeminfo { -void BuildStorageUnitInfo(const chrome::StorageInfo& info, +void BuildStorageUnitInfo(const StorageInfo& info, StorageUnitInfo* unit) { unit->id = StorageMonitor::GetInstance()->GetTransientIdForDeviceId( info.device_id()); unit->name = UTF16ToUTF8(info.name()); // TODO(hmin): Might need to take MTP device into consideration. - unit->type = chrome::StorageInfo::IsRemovableDevice(info.device_id()) ? + unit->type = StorageInfo::IsRemovableDevice(info.device_id()) ? STORAGE_UNIT_TYPE_REMOVABLE : STORAGE_UNIT_TYPE_FIXED; unit->capacity = static_cast<double>(info.total_size_in_bytes()); } @@ -77,11 +76,11 @@ bool StorageInfoProvider::QueryInfo() { void StorageInfoProvider::GetAllStoragesIntoInfoList() { info_.clear(); - std::vector<chrome::StorageInfo> storage_list = + std::vector<StorageInfo> storage_list = StorageMonitor::GetInstance()->GetAllAvailableStorages(); - std::vector<chrome::StorageInfo>::const_iterator it = storage_list.begin(); - for (; it != storage_list.end(); ++it) { + for (std::vector<StorageInfo>::const_iterator it = storage_list.begin(); + it != storage_list.end(); ++it) { linked_ptr<StorageUnitInfo> unit(new StorageUnitInfo()); systeminfo::BuildStorageUnitInfo(*it, unit.get()); info_.push_back(unit); 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 859ea87..5bcf4a1 100644 --- a/chrome/browser/extensions/api/system_storage/storage_info_provider.h +++ b/chrome/browser/extensions/api/system_storage/storage_info_provider.h @@ -22,10 +22,10 @@ namespace extensions { namespace systeminfo { -// Build StorageUnitInfo struct from chrome::StorageInfo instance. The |unit| +// Build StorageUnitInfo struct from StorageInfo instance. The |unit| // parameter is the output value. -void BuildStorageUnitInfo(const chrome::StorageInfo& info, - api::system_storage::StorageUnitInfo* unit); +void BuildStorageUnitInfo(const StorageInfo& info, + api::system_storage::StorageUnitInfo* unit); } // namespace systeminfo diff --git a/chrome/browser/extensions/api/system_storage/system_storage_api.cc b/chrome/browser/extensions/api/system_storage/system_storage_api.cc index 4c2301e..2157bad 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_api.cc +++ b/chrome/browser/extensions/api/system_storage/system_storage_api.cc @@ -42,7 +42,7 @@ bool SystemStorageEjectDeviceFunction::RunImpl() { scoped_ptr<EjectDevice::Params> params(EjectDevice::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); - chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( + StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( &SystemStorageEjectDeviceFunction::OnStorageMonitorInit, this, params->id)); @@ -51,14 +51,14 @@ bool SystemStorageEjectDeviceFunction::RunImpl() { void SystemStorageEjectDeviceFunction::OnStorageMonitorInit( const std::string& transient_device_id) { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::StorageMonitor* monitor = chrome::StorageMonitor::GetInstance(); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + StorageMonitor* monitor = StorageMonitor::GetInstance(); std::string device_id_str = - chrome::StorageMonitor::GetInstance()->GetDeviceIdForTransientId( + StorageMonitor::GetInstance()->GetDeviceIdForTransientId( transient_device_id); if (device_id_str == "") { - HandleResponse(chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE); + HandleResponse(StorageMonitor::EJECT_NO_SUCH_DEVICE); return; } @@ -69,21 +69,21 @@ void SystemStorageEjectDeviceFunction::OnStorageMonitorInit( } void SystemStorageEjectDeviceFunction::HandleResponse( - chrome::StorageMonitor::EjectStatus status) { + StorageMonitor::EjectStatus status) { api::system_storage:: EjectDeviceResultCode result = api::system_storage::EJECT_DEVICE_RESULT_CODE_FAILURE; switch (status) { - case chrome::StorageMonitor::EJECT_OK: + case StorageMonitor::EJECT_OK: result = api::system_storage::EJECT_DEVICE_RESULT_CODE_SUCCESS; break; - case chrome::StorageMonitor::EJECT_IN_USE: + case StorageMonitor::EJECT_IN_USE: result = api::system_storage::EJECT_DEVICE_RESULT_CODE_IN_USE; break; - case chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE: + case StorageMonitor::EJECT_NO_SUCH_DEVICE: result = api::system_storage:: EJECT_DEVICE_RESULT_CODE_NO_SUCH_DEVICE; break; - case chrome::StorageMonitor::EJECT_FAILURE: + case StorageMonitor::EJECT_FAILURE: result = api::system_storage::EJECT_DEVICE_RESULT_CODE_FAILURE; } 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 0c346f9..07e29a6 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_api.h +++ b/chrome/browser/extensions/api/system_storage/system_storage_api.h @@ -41,7 +41,7 @@ class SystemStorageEjectDeviceFunction void OnStorageMonitorInit(const std::string& transient_device_id); // Eject device request handler. - void HandleResponse(chrome::StorageMonitor::EjectStatus status); + void HandleResponse(StorageMonitor::EjectStatus status); }; } // 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 5cd4fe3..5bd4fe9 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_apitest.cc +++ b/chrome/browser/extensions/api/system_storage/system_storage_apitest.cc @@ -16,7 +16,6 @@ namespace { -using chrome::StorageMonitor; using extensions::StorageUnitInfoList; using extensions::test::TestStorageUnitInfo; using extensions::test::kRemovableStorageData; @@ -35,7 +34,7 @@ class SystemStorageApiTest : public ExtensionApiTest { virtual ~SystemStorageApiTest() {} virtual void SetUpOnMainThread() OVERRIDE { - chrome::test::TestStorageMonitor::CreateForBrowserTests(); + TestStorageMonitor::CreateForBrowserTests(); } virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 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 764fdbb..f366321 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 @@ -34,7 +34,7 @@ class SystemStorageEjectApiTest : public ExtensionApiTest { protected: virtual void SetUpOnMainThread() OVERRIDE { - monitor_ = chrome::test::TestStorageMonitor::CreateForBrowserTests(); + monitor_ = TestStorageMonitor::CreateForBrowserTests(); ExtensionApiTest::SetUpOnMainThread(); } @@ -55,22 +55,22 @@ class SystemStorageEjectApiTest : public ExtensionApiTest { } void Attach() { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::StorageMonitor::GetInstance()->receiver()->ProcessAttach( + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + StorageMonitor::GetInstance()->receiver()->ProcessAttach( extensions::test::BuildStorageInfoFromTestStorageUnitInfo( kRemovableStorageData)); content::RunAllPendingInMessageLoop(); } void Detach() { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::StorageMonitor::GetInstance()->receiver()->ProcessDetach( + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + StorageMonitor::GetInstance()->receiver()->ProcessDetach( kRemovableStorageData.device_id); content::RunAllPendingInMessageLoop(); } protected: - chrome::test::TestStorageMonitor* monitor_; + TestStorageMonitor* monitor_; private: DISALLOW_COPY_AND_ASSIGN(SystemStorageEjectApiTest); diff --git a/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.cc b/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.cc index a6c71e0..2541040 100644 --- a/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.cc +++ b/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.cc @@ -23,8 +23,6 @@ using content::BrowserThread; -namespace chrome { - namespace { #if defined(OS_WIN) @@ -77,5 +75,3 @@ void AVScanningFileValidator::StartPostWriteValidation( AVScanningFileValidator::AVScanningFileValidator() { } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h b/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h index d06c857..b148c29 100644 --- a/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h +++ b/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h @@ -12,8 +12,6 @@ namespace base { class FilePath; } // namespace base -namespace chrome { - // This class supports AV scanning on post write validation. class AVScanningFileValidator : public fileapi::CopyOrMoveFileValidator { public: @@ -32,6 +30,4 @@ class AVScanningFileValidator : public fileapi::CopyOrMoveFileValidator { DISALLOW_COPY_AND_ASSIGN(AVScanningFileValidator); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_AV_SCANNING_FILE_VALIDATOR_H_ diff --git a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc index 98b2da1..52cfd03 100644 --- a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc @@ -21,8 +21,6 @@ using fileapi::FileSystemOperationContext; using fileapi::FileSystemURL; using webkit_blob::ShareableFileReference; -namespace chrome { - namespace { const char kDeviceMediaAsyncFileUtilTempDir[] = "DeviceMediaFileSystem"; @@ -340,5 +338,3 @@ void DeviceMediaAsyncFileUtil::OnSnapshotFileCreatedRunTask( weak_ptr_factory_.GetWeakPtr(), callback)); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h index 42297b5..bf9a7dd 100644 --- a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h +++ b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h @@ -22,8 +22,6 @@ class FileSystemOperationContext; class FileSystemURL; } -namespace chrome { - class DeviceMediaAsyncFileUtil : public fileapi::AsyncFileUtil { public: virtual ~DeviceMediaAsyncFileUtil(); @@ -186,6 +184,4 @@ class DeviceMediaAsyncFileUtil : public fileapi::AsyncFileUtil { DISALLOW_COPY_AND_ASSIGN(DeviceMediaAsyncFileUtil); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ diff --git a/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc b/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc index b9a42a7..8470ba0 100644 --- a/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc +++ b/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc @@ -11,8 +11,6 @@ #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace { // Bounces |path| and |error| to |callback| from the FILE thread to the media @@ -60,5 +58,3 @@ void StartFilePathWatchOnMediaTaskRunner( watch_started_callback, path_changed_callback)); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/file_path_watcher_util.h b/chrome/browser/media_galleries/fileapi/file_path_watcher_util.h index f5a1e57..bf158ac 100644 --- a/chrome/browser/media_galleries/fileapi/file_path_watcher_util.h +++ b/chrome/browser/media_galleries/fileapi/file_path_watcher_util.h @@ -10,8 +10,6 @@ #include "base/files/file_path.h" #include "base/files/file_path_watcher.h" -namespace chrome { - typedef base::Callback<void(scoped_ptr<base::FilePathWatcher> watcher)> FileWatchStartedCallback; @@ -23,6 +21,4 @@ void StartFilePathWatchOnMediaTaskRunner( const FileWatchStartedCallback& watch_started_callback, const base::FilePathWatcher::Callback& path_changed_callback); -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILE_PATH_WATCHER_UTIL_H_ diff --git a/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc b/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc index b23ed22..6820e0b 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc @@ -24,8 +24,6 @@ #include "third_party/icu/source/common/unicode/locid.h" #include "webkit/browser/fileapi/native_file_util.h" -using chrome::MediaFileSystemBackend; - namespace itunes { namespace { @@ -188,7 +186,7 @@ ITunesDataProvider::ITunesDataProvider(const base::FilePath& library_path) DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); DCHECK(!library_path_.empty()); - chrome::StartFilePathWatchOnMediaTaskRunner( + StartFilePathWatchOnMediaTaskRunner( library_path_, base::Bind(&ITunesDataProvider::OnLibraryWatchStarted, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc b/chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc index b716a9b..9682044 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc @@ -22,8 +22,6 @@ #include "content/public/browser/browser_thread.h" #include "url/gurl.h" -using chrome::MediaFileSystemBackend; - namespace itunes { namespace { @@ -76,7 +74,7 @@ class ITunesDataProviderTest : public InProcessBrowserTest { // GetInstance() first. It shouldn't matter what thread creates, however // in practice it is always created on the UI thread, so this calls // GetInstance here to mirror those real conditions. - chrome::ImportedMediaGalleryRegistry::GetInstance(); + ImportedMediaGalleryRegistry::GetInstance(); InProcessBrowserTest::SetUp(); } @@ -103,7 +101,7 @@ class ITunesDataProviderTest : public InProcessBrowserTest { } ITunesDataProvider* data_provider() const { - return chrome::ImportedMediaGalleryRegistry::ITunesDataProvider(); + return ImportedMediaGalleryRegistry::ITunesDataProvider(); } const base::FilePath& library_dir() const { @@ -142,8 +140,8 @@ class ITunesDataProviderTest : public InProcessBrowserTest { void TestDone() { DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); - chrome::ImportedMediaGalleryRegistry* imported_registry = - chrome::ImportedMediaGalleryRegistry::GetInstance(); + ImportedMediaGalleryRegistry* imported_registry = + ImportedMediaGalleryRegistry::GetInstance(); imported_registry->itunes_data_provider_.reset(); content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, quit_closure_); @@ -152,8 +150,8 @@ class ITunesDataProviderTest : public InProcessBrowserTest { private: void StartTestOnMediaTaskRunner() { DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); - chrome::ImportedMediaGalleryRegistry* imported_registry = - chrome::ImportedMediaGalleryRegistry::GetInstance(); + ImportedMediaGalleryRegistry* imported_registry = + ImportedMediaGalleryRegistry::GetInstance(); imported_registry->itunes_data_provider_.reset( new TestITunesDataProvider( XmlFile(), diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util.cc index 75cc8d7..1bdbdd6 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util.cc @@ -43,8 +43,8 @@ const char kITunesMediaDir[] = "iTunes Media"; const char kITunesMusicDir[] = "Music"; const char kITunesAutoAddDir[] = "Automatically Add to iTunes"; -ITunesFileUtil::ITunesFileUtil(chrome::MediaPathFilter* media_path_filter) - : chrome::NativeMediaFileUtil(media_path_filter), +ITunesFileUtil::ITunesFileUtil(MediaPathFilter* media_path_filter) + : NativeMediaFileUtil(media_path_filter), weak_factory_(this), imported_registry_(NULL) { } @@ -372,7 +372,7 @@ void ITunesFileUtil::CreateSnapshotFileWithFreshDataProvider( ITunesDataProvider* ITunesFileUtil::GetDataProvider() { if (!imported_registry_) - imported_registry_ = chrome::ImportedMediaGalleryRegistry::GetInstance(); + imported_registry_ = ImportedMediaGalleryRegistry::GetInstance(); return imported_registry_->ITunesDataProvider(); } diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util.h b/chrome/browser/media_galleries/fileapi/itunes_file_util.h index 5315af6..7014956 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util.h +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util.h @@ -9,9 +9,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" -namespace chrome { class ImportedMediaGalleryRegistry; -} namespace itunes { @@ -22,9 +20,9 @@ extern const char kITunesMediaDir[]; extern const char kITunesMusicDir[]; extern const char kITunesAutoAddDir[]; -class ITunesFileUtil : public chrome::NativeMediaFileUtil { +class ITunesFileUtil : public NativeMediaFileUtil { public: - explicit ITunesFileUtil(chrome::MediaPathFilter* media_path_filter); + explicit ITunesFileUtil(MediaPathFilter* media_path_filter); virtual ~ITunesFileUtil(); protected: @@ -82,7 +80,7 @@ class ITunesFileUtil : public chrome::NativeMediaFileUtil { base::WeakPtrFactory<ITunesFileUtil> weak_factory_; - chrome::ImportedMediaGalleryRegistry* imported_registry_; + ImportedMediaGalleryRegistry* imported_registry_; DISALLOW_COPY_AND_ASSIGN(ITunesFileUtil); }; diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc index c6a63c5..e4336bc 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc @@ -96,7 +96,7 @@ class TestITunesDataProvider : public ITunesDataProvider { class TestITunesFileUtil : public ITunesFileUtil { public: - explicit TestITunesFileUtil(chrome::MediaPathFilter* media_path_filter, + explicit TestITunesFileUtil(MediaPathFilter* media_path_filter, ITunesDataProvider* data_provider) : ITunesFileUtil(media_path_filter), data_provider_(data_provider) { @@ -111,14 +111,13 @@ class TestITunesFileUtil : public ITunesFileUtil { ITunesDataProvider* data_provider_; }; -class TestMediaFileSystemBackend - : public chrome::MediaFileSystemBackend { +class TestMediaFileSystemBackend : public MediaFileSystemBackend { public: TestMediaFileSystemBackend(const base::FilePath& profile_path, ITunesFileUtil* itunes_file_util) - : chrome::MediaFileSystemBackend( + : MediaFileSystemBackend( profile_path, - chrome::MediaFileSystemBackend::MediaTaskRunner().get()), + MediaFileSystemBackend::MediaTaskRunner().get()), test_file_util_(itunes_file_util) {} virtual fileapi::AsyncFileUtil* @@ -160,17 +159,17 @@ class ItunesFileUtilTest : public testing::Test { new quota::MockSpecialStoragePolicy(); // Initialize fake ItunesDataProvider on media task runner thread. - chrome::MediaFileSystemBackend::MediaTaskRunner()->PostTask( + MediaFileSystemBackend::MediaTaskRunner()->PostTask( FROM_HERE, base::Bind(&ItunesFileUtilTest::SetUpDataProvider, base::Unretained(this))); base::WaitableEvent event(true, false /* initially_signalled */); - chrome::MediaFileSystemBackend::MediaTaskRunner()->PostTask( + MediaFileSystemBackend::MediaTaskRunner()->PostTask( FROM_HERE, base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event))); event.Wait(); - media_path_filter_.reset(new chrome::MediaPathFilter()); + media_path_filter_.reset(new MediaPathFilter()); ScopedVector<fileapi::FileSystemBackend> additional_providers; additional_providers.push_back(new TestMediaFileSystemBackend( profile_dir_.path(), @@ -224,7 +223,7 @@ class ItunesFileUtilTest : public testing::Test { base::ScopedTempDir fake_library_dir_; scoped_refptr<fileapi::FileSystemContext> file_system_context_; - scoped_ptr<chrome::MediaPathFilter> media_path_filter_; + scoped_ptr<MediaPathFilter> media_path_filter_; scoped_ptr<TestITunesDataProvider> itunes_data_provider_; DISALLOW_COPY_AND_ASSIGN(ItunesFileUtilTest); diff --git a/chrome/browser/media_galleries/fileapi/itunes_finder.cc b/chrome/browser/media_galleries/fileapi/itunes_finder.cc index 1a59629..4de33cb 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_finder.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_finder.cc @@ -61,10 +61,8 @@ void ITunesFinder::FinishOnUIThread(const std::string& unique_id) const { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); std::string device_id; - if (!unique_id.empty()) { - device_id = chrome::StorageInfo::MakeDeviceId(chrome::StorageInfo::ITUNES, - unique_id); - } + if (!unique_id.empty()) + device_id = StorageInfo::MakeDeviceId(StorageInfo::ITUNES, unique_id); callback_.Run(device_id); } diff --git a/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc b/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc index 4dd063e..0185579 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc @@ -38,8 +38,6 @@ using fileapi::FileSystemContext; using fileapi::FileSystemURL; -namespace chrome { - const char MediaFileSystemBackend::kMediaTaskRunnerName[] = "media-task-runner"; @@ -193,5 +191,3 @@ MediaFileSystemBackend::GetQuotaUtil() { // No quota support. return NULL; } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/media_file_system_backend.h b/chrome/browser/media_galleries/fileapi/media_file_system_backend.h index 06475e0..8b36c61 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_system_backend.h +++ b/chrome/browser/media_galleries/fileapi/media_file_system_backend.h @@ -13,8 +13,6 @@ namespace base { class SequencedTaskRunner; } -namespace chrome { - class MediaPathFilter; class DeviceMediaAsyncFileUtil; @@ -80,6 +78,4 @@ class MediaFileSystemBackend : public fileapi::FileSystemBackend { DISALLOW_COPY_AND_ASSIGN(MediaFileSystemBackend); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc b/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc index 3a04fcb..036d914 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc @@ -65,8 +65,6 @@ base::FilePath GetMediaTestDir() { } // namespace -namespace chrome { - class MediaFileValidatorTest : public InProcessBrowserTest { public: MediaFileValidatorTest() : test_file_size_(0) {} @@ -279,5 +277,3 @@ IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); MoveTestFromFile("multitrack.webm", test_file, true); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc index ead22c1..f7e9434 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc @@ -11,8 +11,6 @@ #include "webkit/browser/fileapi/copy_or_move_file_validator.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace chrome { - namespace { class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator { @@ -32,7 +30,7 @@ class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator { } private: - friend class chrome::MediaFileValidatorFactory; + friend class ::MediaFileValidatorFactory; InvalidFileValidator() {} @@ -56,5 +54,3 @@ MediaFileValidatorFactory::CreateCopyOrMoveFileValidator( return new InvalidFileValidator(); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h index 0969fad..1da7f03 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h +++ b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h @@ -16,8 +16,6 @@ namespace fileapi { class FileSystemURL; } -namespace chrome { - // A factory for media file validators. A media file validator will use various // strategies (depending on the file type) to attempt to verify that the file // is a valid media file. @@ -35,6 +33,4 @@ class MediaFileValidatorFactory DISALLOW_COPY_AND_ASSIGN(MediaFileValidatorFactory); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_VALIDATOR_FACTORY_H_ diff --git a/chrome/browser/media_galleries/fileapi/media_path_filter.cc b/chrome/browser/media_galleries/fileapi/media_path_filter.cc index d92503c..b82e25e 100644 --- a/chrome/browser/media_galleries/fileapi/media_path_filter.cc +++ b/chrome/browser/media_galleries/fileapi/media_path_filter.cc @@ -10,8 +10,6 @@ #include "base/strings/string_util.h" #include "net/base/mime_util.h" -namespace chrome { - namespace { const base::FilePath::CharType* const kExtraSupportedExtensions[] = { @@ -121,5 +119,3 @@ void MediaPathFilter::EnsureInitialized() { initialized_ = true; } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/media_path_filter.h b/chrome/browser/media_galleries/fileapi/media_path_filter.h index c74d4d3..21db8dd 100644 --- a/chrome/browser/media_galleries/fileapi/media_path_filter.h +++ b/chrome/browser/media_galleries/fileapi/media_path_filter.h @@ -14,8 +14,6 @@ namespace base { class FilePath; } -namespace chrome { - // This class holds the list of file path extensions that we should expose on // media filesystem. class MediaPathFilter { @@ -36,6 +34,4 @@ class MediaPathFilter { DISALLOW_COPY_AND_ASSIGN(MediaPathFilter); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_ diff --git a/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h b/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h index 53fe93b..1f51be8 100644 --- a/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h +++ b/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h @@ -14,8 +14,6 @@ namespace base { class FilePath; } -namespace chrome { - // Asynchronous delegate for media transfer protocol (MTP) device to perform // media device isolated file system operations. Class that implements this // delegate does the actual communication with the MTP device. @@ -80,6 +78,4 @@ class MTPDeviceAsyncDelegate { virtual ~MTPDeviceAsyncDelegate() {} }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ diff --git a/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc index 7f74013..cf911969 100644 --- a/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc +++ b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc @@ -11,8 +11,6 @@ #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" #include "webkit/browser/fileapi/isolated_context.h" -namespace chrome { - namespace { base::LazyInstance<MTPDeviceMapService> g_mtp_device_map_service = @@ -68,6 +66,5 @@ MTPDeviceAsyncDelegate* MTPDeviceMapService::GetMTPDeviceAsyncDelegate( MTPDeviceMapService::MTPDeviceMapService() { } -MTPDeviceMapService::~MTPDeviceMapService() {} - -} // namespace chrome +MTPDeviceMapService::~MTPDeviceMapService() { +} diff --git a/chrome/browser/media_galleries/fileapi/mtp_device_map_service.h b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.h index 129a3c1..5174c38 100644 --- a/chrome/browser/media_galleries/fileapi/mtp_device_map_service.h +++ b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.h @@ -11,8 +11,6 @@ #include "base/lazy_instance.h" #include "base/threading/thread_checker.h" -namespace chrome { - class MTPDeviceAsyncDelegate; // This class provides media transfer protocol (MTP) device delegate to @@ -62,6 +60,4 @@ class MTPDeviceMapService { DISALLOW_COPY_AND_ASSIGN(MTPDeviceMapService); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_MAP_SERVICE_H_ diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc index c78f5b1c..a4d6927 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc @@ -22,8 +22,6 @@ #include "webkit/browser/fileapi/native_file_util.h" #include "webkit/common/blob/shareable_file_reference.h" -namespace chrome { - namespace { // Used to skip the hidden folders and files. Returns true if the file specified @@ -626,5 +624,3 @@ NativeMediaFileUtil::GetFilteredLocalFilePathForExistingFileOrDirectory( *local_file_path = file_path; return base::PLATFORM_FILE_OK; } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util.h b/chrome/browser/media_galleries/fileapi/native_media_file_util.h index 03d6b6f..05cfc9c 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util.h +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.h @@ -9,8 +9,6 @@ #include "base/memory/weak_ptr.h" #include "webkit/browser/fileapi/async_file_util.h" -namespace chrome { - class MediaPathFilter; // This class handles native file system operations with media type filtering. @@ -173,7 +171,7 @@ class NativeMediaFileUtil : public fileapi::AsyncFileUtil { scoped_refptr<webkit_blob::ShareableFileReference>* file_ref); protected: - chrome::MediaPathFilter* media_path_filter() { + MediaPathFilter* media_path_filter() { return media_path_filter_; } @@ -202,11 +200,9 @@ class NativeMediaFileUtil : public fileapi::AsyncFileUtil { base::WeakPtrFactory<NativeMediaFileUtil> weak_factory_; // Not owned, owned by the backend which owns this. - chrome::MediaPathFilter* media_path_filter_; + MediaPathFilter* media_path_filter_; DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_ diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc index a71fac4..c131af6 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc @@ -32,8 +32,6 @@ using fileapi::FileSystemOperation; using fileapi::FileSystemURL; -namespace chrome { - namespace { typedef FileSystemOperation::FileEntryList FileEntryList; @@ -538,5 +536,3 @@ TEST_F(NativeMediaFileUtilTest, CreateSnapshot) { ASSERT_EQ(expected_error, error); } } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/picasa_data_provider.cc b/chrome/browser/media_galleries/fileapi/picasa_data_provider.cc index 323c42d..0ffbddd 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_data_provider.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_data_provider.cc @@ -19,8 +19,6 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" -using chrome::MediaFileSystemBackend; - namespace picasa { namespace { @@ -42,7 +40,7 @@ PicasaDataProvider::PicasaDataProvider(const base::FilePath& database_path) weak_factory_(this) { DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); - chrome::StartFilePathWatchOnMediaTaskRunner( + StartFilePathWatchOnMediaTaskRunner( database_path_.DirName().AppendASCII(kPicasaTempDirName), base::Bind(&PicasaDataProvider::OnTempDirWatchStarted, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc b/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc index 396e571..0409978 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc @@ -18,8 +18,6 @@ #include "chrome/test/base/in_process_browser_test.h" #include "content/public/test/test_browser_thread.h" -using chrome::MediaFileSystemBackend; - namespace picasa { namespace { diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util.cc b/chrome/browser/media_galleries/fileapi/picasa_file_util.cc index d632858..fa4ee10 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util.cc @@ -65,8 +65,8 @@ PicasaDataProvider::DataType GetDataTypeForURL( const char kPicasaDirAlbums[] = "albums"; const char kPicasaDirFolders[] = "folders"; -PicasaFileUtil::PicasaFileUtil(chrome::MediaPathFilter* media_path_filter) - : chrome::NativeMediaFileUtil(media_path_filter), +PicasaFileUtil::PicasaFileUtil(MediaPathFilter* media_path_filter) + : NativeMediaFileUtil(media_path_filter), weak_factory_(this) { } @@ -367,7 +367,7 @@ void PicasaFileUtil::ReadDirectoryWithFreshDataProvider( } PicasaDataProvider* PicasaFileUtil::GetDataProvider() { - return chrome::ImportedMediaGalleryRegistry::PicasaDataProvider(); + return ImportedMediaGalleryRegistry::PicasaDataProvider(); } } // namespace picasa diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util.h b/chrome/browser/media_galleries/fileapi/picasa_file_util.h index b14d115..92d9b70 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util.h +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util.h @@ -25,9 +25,9 @@ extern const char kPicasaDirFolders[]; // - /folders/ // - /folders/My Pictures 2013-08-21/flower.jpg // - /folders/Photos 2013-08-21/ -class PicasaFileUtil : public chrome::NativeMediaFileUtil { +class PicasaFileUtil : public NativeMediaFileUtil { public: - explicit PicasaFileUtil(chrome::MediaPathFilter* media_path_filter); + explicit PicasaFileUtil(MediaPathFilter* media_path_filter); virtual ~PicasaFileUtil(); protected: diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc index 3595ec8..11ecf44 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc @@ -159,7 +159,7 @@ void ReadDirectoryTestHelper(fileapi::FileSystemOperationRunner* runner, void SynchronouslyRunOnMediaTaskRunner(const base::Closure& closure) { base::RunLoop loop; - chrome::MediaFileSystemBackend::MediaTaskRunner()->PostTaskAndReply( + MediaFileSystemBackend::MediaTaskRunner()->PostTaskAndReply( FROM_HERE, closure, loop.QuitClosure()); @@ -187,7 +187,7 @@ void CreateSnapshotFileTestHelperCallback( class TestPicasaFileUtil : public PicasaFileUtil { public: - TestPicasaFileUtil(chrome::MediaPathFilter* media_path_filter, + TestPicasaFileUtil(MediaPathFilter* media_path_filter, PicasaDataProvider* data_provider) : PicasaFileUtil(media_path_filter), data_provider_(data_provider) { @@ -201,14 +201,12 @@ class TestPicasaFileUtil : public PicasaFileUtil { PicasaDataProvider* data_provider_; }; -class TestMediaFileSystemBackend - : public chrome::MediaFileSystemBackend { +class TestMediaFileSystemBackend : public MediaFileSystemBackend { public: TestMediaFileSystemBackend(const base::FilePath& profile_path, PicasaFileUtil* picasa_file_util) - : chrome::MediaFileSystemBackend( - profile_path, - chrome::MediaFileSystemBackend::MediaTaskRunner().get()), + : MediaFileSystemBackend(profile_path, + MediaFileSystemBackend::MediaTaskRunner().get()), test_file_util_(picasa_file_util) {} virtual fileapi::AsyncFileUtil* @@ -239,7 +237,7 @@ class PicasaFileUtilTest : public testing::Test { SynchronouslyRunOnMediaTaskRunner(base::Bind( &PicasaFileUtilTest::SetUpOnMediaTaskRunner, base::Unretained(this))); - media_path_filter_.reset(new chrome::MediaPathFilter()); + media_path_filter_.reset(new MediaPathFilter()); ScopedVector<fileapi::FileSystemBackend> additional_providers; additional_providers.push_back(new TestMediaFileSystemBackend( @@ -381,7 +379,7 @@ class PicasaFileUtilTest : public testing::Test { scoped_refptr<fileapi::FileSystemContext> file_system_context_; scoped_ptr<PicasaDataProvider> picasa_data_provider_; - scoped_ptr<chrome::MediaPathFilter> media_path_filter_; + scoped_ptr<MediaPathFilter> media_path_filter_; DISALLOW_COPY_AND_ASSIGN(PicasaFileUtilTest); }; diff --git a/chrome/browser/media_galleries/fileapi/picasa_finder.cc b/chrome/browser/media_galleries/fileapi/picasa_finder.cc index 364b6c6..86b4e12 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_finder.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_finder.cc @@ -47,9 +47,8 @@ base::FilePath FindPicasaDatabaseOnFileThread() { void FinishOnOriginalThread(const PicasaFinder::DeviceIDCallback& callback, const base::FilePath& database_path) { if (!database_path.empty()) - callback.Run(chrome::StorageInfo::MakeDeviceId( - chrome::StorageInfo::PICASA, - database_path.AsUTF8Unsafe())); + callback.Run(StorageInfo::MakeDeviceId(StorageInfo::PICASA, + database_path.AsUTF8Unsafe())); } } // namespace diff --git a/chrome/browser/media_galleries/fileapi/safe_itunes_library_parser.cc b/chrome/browser/media_galleries/fileapi/safe_itunes_library_parser.cc index 0ae9ef4..21dd102 100644 --- a/chrome/browser/media_galleries/fileapi/safe_itunes_library_parser.cc +++ b/chrome/browser/media_galleries/fileapi/safe_itunes_library_parser.cc @@ -10,7 +10,6 @@ #include "content/public/browser/child_process_data.h" #include "ipc/ipc_platform_file.h" -using chrome::MediaFileSystemBackend; using content::BrowserThread; using content::UtilityProcessHost; diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc b/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc index 47709b6..1660765 100644 --- a/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc +++ b/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc @@ -11,7 +11,6 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" -using chrome::MediaFileSystemBackend; using content::BrowserThread; namespace picasa { diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc index 7e50ded..9f37469 100644 --- a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc +++ b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc @@ -11,7 +11,6 @@ #include "content/public/browser/child_process_data.h" #include "content/public/browser/utility_process_host.h" -using chrome::MediaFileSystemBackend; using content::BrowserThread; using content::UtilityProcessHost; diff --git a/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h index d2dad4f..b1de6d5 100644 --- a/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h +++ b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h @@ -12,17 +12,14 @@ #include "base/platform_file.h" #include "chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h" -class SafeAudioVideoChecker; - -namespace chrome { class MediaFileValidatorFactory; -} +class SafeAudioVideoChecker; // Uses SafeAudioVideoChecker to validate supported audio and video files in // the utility process and then uses AVScanningFileValidator to ask the OS to // virus scan them. The entire file is not decoded so a positive result from // this class does not make the file safe to use in the browser process. -class SupportedAudioVideoChecker : public chrome::AVScanningFileValidator { +class SupportedAudioVideoChecker : public AVScanningFileValidator { public: virtual ~SupportedAudioVideoChecker(); @@ -32,7 +29,7 @@ class SupportedAudioVideoChecker : public chrome::AVScanningFileValidator { const ResultCallback& result_callback) OVERRIDE; private: - friend class chrome::MediaFileValidatorFactory; + friend class MediaFileValidatorFactory; explicit SupportedAudioVideoChecker(const base::FilePath& file); diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc index 24a400b..9b2ecac 100644 --- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc +++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc @@ -18,8 +18,6 @@ using content::BrowserThread; -namespace chrome { - namespace { // Arbitrary limit to sanity check the file size. @@ -137,5 +135,3 @@ void SupportedImageTypeValidator::OnFileOpen(scoped_ptr<std::string> data) { decoder_->Start(content::BrowserThread::GetMessageLoopProxyForThread( BrowserThread::IO)); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h index 11e479f..75dea9c 100644 --- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h +++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h @@ -13,8 +13,6 @@ class ImageDecoder; -namespace chrome { - class MediaFileValidatorFactory; // Use ImageDecoder to determine if the file decodes without error. Handles @@ -43,6 +41,4 @@ class SupportedImageTypeValidator : public AVScanningFileValidator { DISALLOW_COPY_AND_ASSIGN(SupportedImageTypeValidator); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_IMAGE_TYPE_VALIDATOR_H_ diff --git a/chrome/browser/media_galleries/imported_media_gallery_registry.cc b/chrome/browser/media_galleries/imported_media_gallery_registry.cc index 315243e..a7dea9c 100644 --- a/chrome/browser/media_galleries/imported_media_gallery_registry.cc +++ b/chrome/browser/media_galleries/imported_media_gallery_registry.cc @@ -16,8 +16,6 @@ using base::Bind; using fileapi::IsolatedContext; -namespace chrome { - namespace { static base::LazyInstance<ImportedMediaGalleryRegistry>::Leaky @@ -181,5 +179,3 @@ void ImportedMediaGalleryRegistry::RevokeITunesFileSystem() { itunes_data_provider_.reset(); } #endif // defined(OS_WIN) || defined(OS_MACOSX) - -} // namespace chrome diff --git a/chrome/browser/media_galleries/imported_media_gallery_registry.h b/chrome/browser/media_galleries/imported_media_gallery_registry.h index 04fb682f..4929e5e 100644 --- a/chrome/browser/media_galleries/imported_media_gallery_registry.h +++ b/chrome/browser/media_galleries/imported_media_gallery_registry.h @@ -23,8 +23,6 @@ class PicasaDataProvider; class PicasaDataProviderTest; } -namespace chrome { - // This class lives on the MediaTaskRunner thread. It has some static // methods which are called on the UI thread. // @@ -81,6 +79,4 @@ class ImportedMediaGalleryRegistry { DISALLOW_COPY_AND_ASSIGN(ImportedMediaGalleryRegistry); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_IMPORTED_MEDIA_GALLERY_REGISTRY_H_ diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc index 1e59dd5..2d74f1d 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc @@ -12,8 +12,6 @@ #include "chrome/browser/media_galleries/linux/snapshot_file_details.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace { // File path separator constant. @@ -456,5 +454,3 @@ void CreateMTPDeviceAsyncDelegate( DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); callback.Run(new MTPDeviceDelegateImplLinux(device_location)); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h index 0122af5..25a3b05 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h +++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h @@ -20,8 +20,6 @@ namespace base { class FilePath; } -namespace chrome { - struct SnapshotRequestInfo; // MTPDeviceDelegateImplLinux communicates with the media transfer protocol @@ -195,6 +193,4 @@ class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate { DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ diff --git a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc b/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc index e35277e..4a0584a 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc @@ -6,8 +6,6 @@ #include "base/logging.h" -namespace chrome { - MTPDeviceObjectEnumerator::MTPDeviceObjectEnumerator( const std::vector<MtpFileEntry>& entries) : file_entries_(entries), @@ -63,5 +61,3 @@ bool MTPDeviceObjectEnumerator::HasMoreEntries() const { bool MTPDeviceObjectEnumerator::IsIndexReadyAndInRange() const { return is_index_ready_ && HasMoreEntries(); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h b/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h index 31a2ce4..ef92b92 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h +++ b/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h @@ -12,8 +12,6 @@ #include "device/media_transfer_protocol/mtp_file_entry.pb.h" #include "webkit/browser/fileapi/file_system_file_util.h" -namespace chrome { - // Used to enumerate top-level files of an media file system. class MTPDeviceObjectEnumerator : public fileapi::FileSystemFileUtil::AbstractFileEnumerator { @@ -54,6 +52,4 @@ class MTPDeviceObjectEnumerator DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ diff --git a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator_unittest.cc b/chrome/browser/media_galleries/linux/mtp_device_object_enumerator_unittest.cc index 7ab64e6..6fad6df 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator_unittest.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_object_enumerator_unittest.cc @@ -5,8 +5,6 @@ #include "chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - namespace { struct MtpFileEntryData { @@ -73,5 +71,3 @@ TEST_F(MTPDeviceObjectEnumeratorTest, Traversal) { } } // namespace - -} // namespace chrome 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 20306e6..afbe77a 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc @@ -15,8 +15,6 @@ #include "webkit/browser/fileapi/async_file_util.h" #include "webkit/common/fileapi/file_system_util.h" -namespace chrome { - namespace { // Does nothing. @@ -182,5 +180,3 @@ void MTPDeviceTaskHelper::HandleDeviceError( FROM_HERE, base::Bind(error_callback, error)); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h index e0be798..c3ceb35 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h @@ -16,8 +16,6 @@ #include "device/media_transfer_protocol/mtp_file_entry.pb.h" #include "webkit/browser/fileapi/async_file_util.h" -namespace chrome { - class MTPReadFileWorker; struct SnapshotRequestInfo; @@ -151,6 +149,4 @@ class MTPDeviceTaskHelper { DISALLOW_COPY_AND_ASSIGN(MTPDeviceTaskHelper); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_TASK_HELPER_H_ diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.cc b/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.cc index aedce85..ab92b8f 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.cc @@ -9,8 +9,6 @@ #include "chrome/browser/media_galleries/linux/mtp_device_task_helper.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace { base::LazyInstance<MTPDeviceTaskHelperMapService> @@ -56,5 +54,3 @@ MTPDeviceTaskHelperMapService::MTPDeviceTaskHelperMapService() { MTPDeviceTaskHelperMapService::~MTPDeviceTaskHelperMapService() { } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h b/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h index fb3f381..d13920c 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h @@ -10,8 +10,6 @@ #include "base/lazy_instance.h" -namespace chrome { - class MTPDeviceTaskHelper; // MTPDeviceTaskHelperMapService manages MTPDeviceTaskHelper objects. @@ -53,6 +51,4 @@ class MTPDeviceTaskHelperMapService { DISALLOW_COPY_AND_ASSIGN(MTPDeviceTaskHelperMapService); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_TASK_HELPER_MAP_SERVICE_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 29bea5df..e991893 100644 --- a/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc +++ b/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc @@ -16,8 +16,6 @@ using content::BrowserThread; -namespace chrome { - namespace { // Appends |data| to the snapshot file specified by the |snapshot_file_path| on @@ -140,5 +138,3 @@ void MTPReadFileWorker::OnDidWriteIntoSnapshotFile( snapshot_file_details->file_info(), snapshot_file_details->snapshot_file_path())); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/linux/mtp_read_file_worker.h b/chrome/browser/media_galleries/linux/mtp_read_file_worker.h index bbc6641..d330d19 100644 --- a/chrome/browser/media_galleries/linux/mtp_read_file_worker.h +++ b/chrome/browser/media_galleries/linux/mtp_read_file_worker.h @@ -16,8 +16,6 @@ namespace base { class FilePath; } -namespace chrome { - class SnapshotFileDetails; struct SnapshotRequestInfo; @@ -88,6 +86,4 @@ class MTPReadFileWorker { DISALLOW_COPY_AND_ASSIGN(MTPReadFileWorker); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_READ_FILE_WORKER_H_ diff --git a/chrome/browser/media_galleries/linux/snapshot_file_details.cc b/chrome/browser/media_galleries/linux/snapshot_file_details.cc index 8f2e709..4a4b67c 100644 --- a/chrome/browser/media_galleries/linux/snapshot_file_details.cc +++ b/chrome/browser/media_galleries/linux/snapshot_file_details.cc @@ -6,8 +6,6 @@ #include "base/safe_numerics.h" -namespace chrome { - //////////////////////////////////////////////////////////////////////////////// // SnapshotRequestInfo // //////////////////////////////////////////////////////////////////////////////// @@ -68,5 +66,3 @@ uint32 SnapshotFileDetails::BytesToRead() const { kReadChunkSize, base::checked_numeric_cast<uint32>(file_info_.size) - bytes_written_); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/linux/snapshot_file_details.h b/chrome/browser/media_galleries/linux/snapshot_file_details.h index e358b39..4d3fc52 100644 --- a/chrome/browser/media_galleries/linux/snapshot_file_details.h +++ b/chrome/browser/media_galleries/linux/snapshot_file_details.h @@ -13,8 +13,6 @@ #include "base/platform_file.h" #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" -namespace chrome { - // Used to represent snapshot file request params. struct SnapshotRequestInfo { SnapshotRequestInfo( @@ -111,6 +109,4 @@ class SnapshotFileDetails { DISALLOW_COPY_AND_ASSIGN(SnapshotFileDetails); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_SNAPSHOT_FILE_DETAILS_H_ diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h index 1de9c97..fecd069 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h @@ -15,8 +15,6 @@ #include "base/platform_file.h" #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" -namespace chrome { - // Delegate for presenting an Image Capture device through the filesystem // API. The synthetic filesystem will be rooted at the constructed location, // and names of all files notified through the ItemAdded call will be @@ -153,6 +151,4 @@ class MTPDeviceDelegateImplMac : public MTPDeviceAsyncDelegate { DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplMac); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MAC_MTP_DEVICE_DELEGATE_IMPL_MAC_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 87119f1..e977243 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 @@ -14,8 +14,6 @@ #include "content/public/browser/browser_thread.h" #include "webkit/browser/fileapi/async_file_util.h" -namespace chrome { - namespace { int kReadDirectoryTimeLimitSeconds = 20; @@ -478,6 +476,3 @@ void CreateMTPDeviceAsyncDelegate( cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); } - -} // namespace chrome - 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 f57ef18..bdab323 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 @@ -184,15 +184,14 @@ class MTPDeviceDelegateImplMacTest : public testing::Test { content::BrowserThread::IO)); ASSERT_TRUE(io_thread_->Start()); - chrome::test::TestStorageMonitor* monitor = - chrome::test::TestStorageMonitor::CreateAndInstall(); + TestStorageMonitor* monitor = TestStorageMonitor::CreateAndInstall(); manager_.SetNotifications(monitor->receiver()); camera_ = [MockMTPICCameraDevice alloc]; id<ICDeviceBrowserDelegate> delegate = manager_.device_browser(); [delegate deviceBrowser:nil didAddDevice:camera_ moreComing:NO]; - delegate_ = new chrome::MTPDeviceDelegateImplMac(kDeviceId, kDevicePath); + delegate_ = new MTPDeviceDelegateImplMac(kDeviceId, kDevicePath); } virtual void TearDown() OVERRIDE { @@ -201,7 +200,7 @@ class MTPDeviceDelegateImplMacTest : public testing::Test { delegate_->CancelPendingTasksAndDeleteDelegate(); - chrome::test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); io_thread_->Stop(); } @@ -308,11 +307,11 @@ class MTPDeviceDelegateImplMacTest : public testing::Test { scoped_ptr<content::TestBrowserThread> file_thread_; scoped_ptr<content::TestBrowserThread> io_thread_; base::ScopedTempDir temp_dir_; - chrome::ImageCaptureDeviceManager manager_; + ImageCaptureDeviceManager manager_; MockMTPICCameraDevice* camera_; // This object needs special deletion inside the above |task_runner_|. - chrome::MTPDeviceDelegateImplMac* delegate_; + MTPDeviceDelegateImplMac* delegate_; base::PlatformFileError error_; base::PlatformFileInfo info_; diff --git a/chrome/browser/media_galleries/media_file_system_context.h b/chrome/browser/media_galleries/media_file_system_context.h index f2dca18..215a212 100644 --- a/chrome/browser/media_galleries/media_file_system_context.h +++ b/chrome/browser/media_galleries/media_file_system_context.h @@ -16,8 +16,6 @@ namespace base { class FilePath; } -namespace chrome { - class MediaFileSystemRegistry; class MediaFileSystemContext { @@ -40,6 +38,4 @@ class MediaFileSystemContext { virtual void RevokeFileSystem(const std::string& fsid) = 0; }; -} // namespace - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_CONTEXT_H_ diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc index 9f57566..f061a7a 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.cc +++ b/chrome/browser/media_galleries/media_file_system_registry.cc @@ -50,8 +50,6 @@ using content::RenderProcessHost; using content::WebContents; using fileapi::IsolatedContext; -namespace chrome { - namespace { struct InvalidatedGalleriesInfo { @@ -742,5 +740,3 @@ void MediaFileSystemRegistry::OnExtensionGalleriesHostEmpty( pref_change_registrar_map_.erase(pref_it); } } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_file_system_registry.h b/chrome/browser/media_galleries/media_file_system_registry.h index 9acdf52..e15c078 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.h +++ b/chrome/browser/media_galleries/media_file_system_registry.h @@ -21,7 +21,12 @@ #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" #include "chrome/browser/storage_monitor/removable_storage_observer.h" +class ExtensionGalleriesHost; +class MediaFileSystemContext; +class MediaGalleriesPreferences; class Profile; +class ScopedMTPDeviceMapEntry; + namespace content { class RenderViewHost; @@ -35,13 +40,6 @@ namespace fileapi { class IsolatedContext; } -namespace chrome { - -class ExtensionGalleriesHost; -class MediaFileSystemContext; -class MediaGalleriesPreferences; -class ScopedMTPDeviceMapEntry; - struct MediaFileSystemInfo { MediaFileSystemInfo(const string16& fs_name, const base::FilePath& fs_path, @@ -136,6 +134,4 @@ class MediaFileSystemRegistry : public RemovableStorageObserver { DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ 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 ce95d3e..a4f6329 100644 --- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc +++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc @@ -56,8 +56,6 @@ using content::BrowserThread; -namespace chrome { - // Not anonymous so it can be friends with MediaFileSystemRegistry. class TestMediaFileSystemContext : public MediaFileSystemContext { public: @@ -745,7 +743,7 @@ size_t MediaFileSystemRegistryTest::GetExtensionGalleriesHostCount( void MediaFileSystemRegistryTest::SetUp() { ChromeRenderViewHostTestHarness::SetUp(); - ASSERT_TRUE(test::TestStorageMonitor::CreateAndInstall()); + ASSERT_TRUE(TestStorageMonitor::CreateAndInstall()); DeleteContents(); SetRenderProcessHostFactory(&rph_factory_); @@ -770,7 +768,7 @@ void MediaFileSystemRegistryTest::TearDown() { MediaFileSystemRegistry* registry = g_browser_process->media_file_system_registry(); EXPECT_EQ(0U, GetExtensionGalleriesHostCount(registry)); - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); #if defined(OS_CHROMEOS) test_user_manager_.reset(); #endif @@ -1030,5 +1028,3 @@ TEST_F(MediaFileSystemRegistryTest, TestNameConstruction) { profile_state->CheckGalleries("names", one_expectation, one_expectation); } } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc index 5973492..e2ae6e7 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc @@ -26,8 +26,6 @@ using extensions::APIPermission; using extensions::Extension; -namespace chrome { - namespace { // Comparator for sorting GalleryPermissionsVector -- sorts @@ -81,7 +79,7 @@ MediaGalleriesDialogController::MediaGalleriesDialogController( preferences_(NULL) {} MediaGalleriesDialogController::~MediaGalleriesDialogController() { - if (chrome::StorageMonitor::GetInstance()) + if (StorageMonitor::GetInstance()) StorageMonitor::GetInstance()->RemoveObserver(this); if (select_folder_dialog_.get()) @@ -410,5 +408,3 @@ void MediaGalleriesDialogController::UpdateGalleriesOnDeviceEvent( // MediaGalleries dialog ------------------------------------------------------- MediaGalleriesDialog::~MediaGalleriesDialog() {} - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.h b/chrome/browser/media_galleries/media_galleries_dialog_controller.h index b50ab46..c461e62 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller.h +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.h @@ -24,8 +24,6 @@ namespace extensions { class Extension; } -namespace chrome { - class MediaGalleriesDialogController; // The view. @@ -190,6 +188,4 @@ class MediaGalleriesDialogController DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogController); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_H_ diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.cc index fd69846..7fcbe5fa 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.cc @@ -6,8 +6,6 @@ using ::testing::Return; -namespace chrome { - MediaGalleriesDialogControllerMock::MediaGalleriesDialogControllerMock( const extensions::Extension& extension) : MediaGalleriesDialogController(extension) { @@ -19,5 +17,3 @@ MediaGalleriesDialogControllerMock::MediaGalleriesDialogControllerMock( MediaGalleriesDialogControllerMock::~MediaGalleriesDialogControllerMock() { } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h b/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h index 6735774..4457938 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h @@ -8,8 +8,6 @@ #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" #include "testing/gmock/include/gmock/gmock.h" -namespace chrome { - class MediaGalleriesDialogControllerMock : public MediaGalleriesDialogController { public: @@ -30,6 +28,4 @@ class MediaGalleriesDialogControllerMock MOCK_METHOD1(DialogFinished, void(bool)); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_MOCK_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 71f54ed..8590e80 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc @@ -12,15 +12,13 @@ #include "chrome/browser/storage_monitor/test_storage_monitor.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - std::string GalleryName(const MediaGalleryPrefInfo& gallery) { string16 name = gallery.GetGalleryDisplayName(); return UTF16ToASCII(name); } TEST(MediaGalleriesDialogControllerTest, TestNameGeneration) { - ASSERT_TRUE(test::TestStorageMonitor::CreateAndInstall()); + ASSERT_TRUE(TestStorageMonitor::CreateAndInstall()); MediaGalleryPrefInfo gallery; gallery.pref_id = 1; gallery.device_id = StorageInfo::MakeDeviceId( @@ -61,7 +59,5 @@ TEST(MediaGalleriesDialogControllerTest, TestNameGeneration) { gallery.path = base::FilePath(FILE_PATH_LITERAL("sub/path")); EXPECT_EQ("path - 977 KB vendor, model", GalleryName(gallery)); - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc b/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc index 0721556..c2af8aa 100644 --- a/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_permissions_unittest.cc @@ -12,8 +12,6 @@ #include "chrome/test/base/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - namespace { void AddGalleryPermission(MediaGalleryPrefId gallery, @@ -48,13 +46,13 @@ class MediaGalleriesPermissionsTest : public extensions::ExtensionPrefsTest { prefs_.pref_service()->CommitPendingWrite(); message_loop_.RunUntilIdle(); - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); testing::Test::TearDown(); } virtual void Initialize() OVERRIDE { - ASSERT_TRUE(test::TestStorageMonitor::CreateAndInstall()); + ASSERT_TRUE(TestStorageMonitor::CreateAndInstall()); profile_.reset(new TestingProfile); gallery_prefs_.reset(new MediaGalleriesPreferences(profile_.get())); gallery_prefs_->SetExtensionPrefsForTesting(prefs()); @@ -139,6 +137,5 @@ class MediaGalleriesPermissionsTest : public extensions::ExtensionPrefsTest { scoped_ptr<TestingProfile> profile_; scoped_ptr<MediaGalleriesPreferences> gallery_prefs_; }; -TEST_F(MediaGalleriesPermissionsTest, MediaGalleries) {} -} // namespace chrome +TEST_F(MediaGalleriesPermissionsTest, MediaGalleries) {} diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc index 804b269..c4466ad 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences.cc @@ -38,8 +38,6 @@ using base::DictionaryValue; using base::ListValue; using extensions::ExtensionPrefs; -namespace chrome { - namespace { // Pref key for the list of media gallery permissions. @@ -367,9 +365,9 @@ void MediaGalleriesPreferences::AddDefaultGalleriesIfFreshProfile() { // Fresh profile case. const int kDirectoryKeys[] = { - DIR_USER_MUSIC, - DIR_USER_PICTURES, - DIR_USER_VIDEOS, + chrome::DIR_USER_MUSIC, + chrome::DIR_USER_PICTURES, + chrome::DIR_USER_VIDEOS, }; for (size_t i = 0; i < arraysize(kDirectoryKeys); ++i) { @@ -947,5 +945,3 @@ void MediaGalleriesPreferences::SetExtensionPrefsForTesting( extensions::ExtensionPrefs* extension_prefs) { extension_prefs_for_testing_ = extension_prefs; } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_galleries_preferences.h b/chrome/browser/media_galleries/media_galleries_preferences.h index f737c4b..eb5a854 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.h +++ b/chrome/browser/media_galleries/media_galleries_preferences.h @@ -33,8 +33,6 @@ namespace user_prefs { class PrefRegistrySyncable; } -namespace chrome { - typedef uint64 MediaGalleryPrefId; const MediaGalleryPrefId kInvalidMediaGalleryPrefId = 0; @@ -304,6 +302,4 @@ class MediaGalleriesPreferences : public BrowserContextKeyedService, DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc index 03fefe2..05bbe95 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc @@ -11,9 +11,9 @@ #include "components/user_prefs/pref_registry_syncable.h" // static -chrome::MediaGalleriesPreferences* +MediaGalleriesPreferences* MediaGalleriesPreferencesFactory::GetForProfile(Profile* profile) { - return static_cast<chrome::MediaGalleriesPreferences*>( + return static_cast<MediaGalleriesPreferences*>( GetInstance()->GetServiceForBrowserContext(profile, true)); } @@ -33,12 +33,12 @@ MediaGalleriesPreferencesFactory::~MediaGalleriesPreferencesFactory() {} BrowserContextKeyedService* MediaGalleriesPreferencesFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { - return new chrome::MediaGalleriesPreferences(static_cast<Profile*>(profile)); + return new MediaGalleriesPreferences(static_cast<Profile*>(profile)); } void MediaGalleriesPreferencesFactory::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* prefs) { - chrome::MediaGalleriesPreferences::RegisterProfilePrefs(prefs); + MediaGalleriesPreferences::RegisterProfilePrefs(prefs); } content::BrowserContext* diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.h b/chrome/browser/media_galleries/media_galleries_preferences_factory.h index 797198f..a97a4ae 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.h +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.h @@ -9,11 +9,8 @@ #include "base/memory/singleton.h" #include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" -class Profile; - -namespace chrome { class MediaGalleriesPreferences; -} +class Profile; // Singleton that owns all MediaGalleriesPreferences and associates them with // Profiles. @@ -22,7 +19,7 @@ class MediaGalleriesPreferencesFactory public: // Use MediaFileSystemRegistry::GetPreferences() to get // MediaGalleriesPreferences. - static chrome::MediaGalleriesPreferences* GetForProfile(Profile* profile); + static MediaGalleriesPreferences* GetForProfile(Profile* profile); static MediaGalleriesPreferencesFactory* GetInstance(); diff --git a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc index 68edbd9..de3b7f5 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc @@ -33,8 +33,6 @@ #include "chrome/browser/chromeos/settings/device_settings_service.h" #endif -namespace chrome { - namespace { class MockGalleryChangeObserver @@ -79,7 +77,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { } virtual void SetUp() OVERRIDE { - ASSERT_TRUE(test::TestStorageMonitor::CreateAndInstall()); + ASSERT_TRUE(TestStorageMonitor::CreateAndInstall()); extensions::TestExtensionSystem* extension_system( static_cast<extensions::TestExtensionSystem*>( @@ -119,7 +117,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { virtual void TearDown() OVERRIDE { Verify(); - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); } void Verify() { @@ -242,7 +240,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { chromeos::ScopedTestUserManager test_user_manager_; #endif - test::TestStorageMonitor monitor_; + TestStorageMonitor monitor_; scoped_ptr<TestingProfile> profile_; scoped_ptr<MediaGalleriesPreferences> gallery_prefs_; @@ -806,7 +804,7 @@ TEST_F(MediaGalleriesPreferencesTest, UpdateSingletonDeviceIdType) { } TEST(MediaGalleryPrefInfoTest, NameGeneration) { - ASSERT_TRUE(test::TestStorageMonitor::CreateAndInstall()); + ASSERT_TRUE(TestStorageMonitor::CreateAndInstall()); MediaGalleryPrefInfo info; info.pref_id = 1; @@ -846,7 +844,5 @@ TEST(MediaGalleryPrefInfoTest, NameGeneration) { EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("unique")).AsUTF8Unsafe(), UTF16ToUTF8(info.GetGalleryTooltip())); - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_galleries_test_util.cc b/chrome/browser/media_galleries/media_galleries_test_util.cc index c2a510d..d07e80c 100644 --- a/chrome/browser/media_galleries/media_galleries_test_util.cc +++ b/chrome/browser/media_galleries/media_galleries_test_util.cc @@ -18,8 +18,6 @@ #include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - scoped_refptr<extensions::Extension> AddMediaGalleriesApp( const std::string& name, const std::vector<std::string>& media_galleries_permissions, @@ -100,5 +98,3 @@ void EnsureMediaDirectoriesExists::Init() { num_galleries_ = 3; #endif } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/media_galleries_test_util.h b/chrome/browser/media_galleries/media_galleries_test_util.h index d18f722..553dd08 100644 --- a/chrome/browser/media_galleries/media_galleries_test_util.h +++ b/chrome/browser/media_galleries/media_galleries_test_util.h @@ -17,8 +17,6 @@ class Extension; class Profile; -namespace chrome { - scoped_refptr<extensions::Extension> AddMediaGalleriesApp( const std::string& name, const std::vector<std::string>& media_galleries_permissions, @@ -46,6 +44,4 @@ class EnsureMediaDirectoriesExists { DISALLOW_COPY_AND_ASSIGN(EnsureMediaDirectoriesExists); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ diff --git a/chrome/browser/media_galleries/mtp_device_delegate_impl.h b/chrome/browser/media_galleries/mtp_device_delegate_impl.h index f23c187..407f7b8 100644 --- a/chrome/browser/media_galleries/mtp_device_delegate_impl.h +++ b/chrome/browser/media_galleries/mtp_device_delegate_impl.h @@ -13,8 +13,6 @@ namespace base { class SequencedTaskRunner; } -namespace chrome { - typedef base::Callback<void(MTPDeviceAsyncDelegate*)> CreateMTPDeviceAsyncDelegateCallback; @@ -22,6 +20,4 @@ void CreateMTPDeviceAsyncDelegate( const base::FilePath::StringType& device_location, const CreateMTPDeviceAsyncDelegateCallback& callback); -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_H_ diff --git a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc index 822fb03..59fb4e6 100644 --- a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc +++ b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc @@ -4,8 +4,6 @@ #include "chrome/browser/media_galleries/scoped_mtp_device_map_entry.h" -namespace chrome { - ScopedMTPDeviceMapEntry::ScopedMTPDeviceMapEntry( const base::FilePath::StringType& device_location, const base::Closure& on_destruction_callback) @@ -16,5 +14,3 @@ ScopedMTPDeviceMapEntry::ScopedMTPDeviceMapEntry( ScopedMTPDeviceMapEntry::~ScopedMTPDeviceMapEntry() { on_destruction_callback_.Run(); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h index ffb6f55..565b6b3 100644 --- a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h +++ b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h @@ -11,8 +11,6 @@ #include "base/sequenced_task_runner_helpers.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - class MTPDeviceAsyncDelegate; // ScopedMTPDeviceMapEntry manages the reference count on a particular @@ -55,6 +53,4 @@ class ScopedMTPDeviceMapEntry DISALLOW_COPY_AND_ASSIGN(ScopedMTPDeviceMapEntry); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_SCOPED_MTP_DEVICE_MAP_ENTRY_H_ 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 7a9028a..bfa81da 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 @@ -31,8 +31,6 @@ #include "content/public/browser/browser_thread.h" #include "webkit/common/fileapi/file_system_util.h" -namespace chrome { - namespace { // Gets the details of the MTP partition storage specified by the @@ -610,5 +608,3 @@ void MTPDeviceDelegateImplWin::OnWroteDataChunkIntoSnapshotFile( current_snapshot_details_.reset(); ProcessNextPendingRequest(); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h index f102032..79672ea 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h @@ -23,8 +23,6 @@ class FilePath; class SequencedTaskRunner; } -namespace chrome { - class SnapshotFileDetails; struct SnapshotRequestInfo; @@ -216,6 +214,4 @@ class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_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 93fd983..8a4a67c 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 @@ -28,8 +28,6 @@ #include "content/public/browser/web_contents.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - namespace { typedef std::map<MediaGalleryPrefId, MediaFileSystemInfo> FSInfoMap; @@ -63,7 +61,7 @@ class MTPDeviceDelegateImplWinTest : public ChromeRenderViewHostTestHarness { bool media_device); // Pointer to the storage monitor. Owned by TestingBrowserProcess. - test::TestStorageMonitorWin* monitor_; + TestStorageMonitorWin* monitor_; scoped_refptr<extensions::Extension> extension_; EnsureMediaDirectoriesExists media_directories_; @@ -72,15 +70,13 @@ class MTPDeviceDelegateImplWinTest : public ChromeRenderViewHostTestHarness { void MTPDeviceDelegateImplWinTest::SetUp() { ChromeRenderViewHostTestHarness::SetUp(); - test::TestStorageMonitor::RemoveSingleton(); - test::TestPortableDeviceWatcherWin* portable_device_watcher = - new test::TestPortableDeviceWatcherWin; - test::TestVolumeMountWatcherWin* mount_watcher = - new test::TestVolumeMountWatcherWin; + TestStorageMonitor::RemoveSingleton(); + TestPortableDeviceWatcherWin* portable_device_watcher = + new TestPortableDeviceWatcherWin; + TestVolumeMountWatcherWin* mount_watcher = new TestVolumeMountWatcherWin; portable_device_watcher->set_use_dummy_mtp_storage_info(true); - scoped_ptr<test::TestStorageMonitorWin> monitor( - new test::TestStorageMonitorWin( - mount_watcher, portable_device_watcher)); + scoped_ptr<TestStorageMonitorWin> monitor( + new TestStorageMonitorWin(mount_watcher, portable_device_watcher)); TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); DCHECK(browser_process); monitor_ = monitor.get(); @@ -105,7 +101,7 @@ void MTPDeviceDelegateImplWinTest::SetUp() { void MTPDeviceDelegateImplWinTest::TearDown() { // Windows storage monitor must be destroyed on the same thread // as construction. - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); ChromeRenderViewHostTestHarness::TearDown(); } @@ -151,7 +147,7 @@ void MTPDeviceDelegateImplWinTest::CheckGalleryInfo( TEST_F(MTPDeviceDelegateImplWinTest, GalleryNameMTP) { base::FilePath location( PortableDeviceWatcherWin::GetStoragePathFromStorageId( - test::TestPortableDeviceWatcherWin::kStorageUniqueIdA)); + TestPortableDeviceWatcherWin::kStorageUniqueIdA)); AttachDevice(StorageInfo::MTP_OR_PTP, "mtp_fake_id", location); content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); @@ -175,5 +171,3 @@ TEST_F(MTPDeviceDelegateImplWinTest, GalleryNameMTP) { } EXPECT_TRUE(checked); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/win/mtp_device_object_entry.cc b/chrome/browser/media_galleries/win/mtp_device_object_entry.cc index 3f45977..127ac01 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_entry.cc +++ b/chrome/browser/media_galleries/win/mtp_device_object_entry.cc @@ -6,8 +6,6 @@ #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" -namespace chrome { - MTPDeviceObjectEntry::MTPDeviceObjectEntry() : is_directory(false), size(0) { } @@ -22,5 +20,3 @@ MTPDeviceObjectEntry::MTPDeviceObjectEntry(const string16& object_id, size(size), last_modified_time(last_modified_time) { } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/win/mtp_device_object_entry.h b/chrome/browser/media_galleries/win/mtp_device_object_entry.h index e9a5e64..775e43b 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_entry.h +++ b/chrome/browser/media_galleries/win/mtp_device_object_entry.h @@ -11,8 +11,6 @@ #include "base/strings/string16.h" #include "base/time/time.h" -namespace chrome { - // MTPDeviceObjectEntry contains the media transfer protocol device object // property values that are obtained using // IPortableDeviceProperties::GetValues(). @@ -43,6 +41,4 @@ struct MTPDeviceObjectEntry { typedef std::vector<MTPDeviceObjectEntry> MTPDeviceObjectEntries; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENTRY_H_ diff --git a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc index 74a3516..5414d0e 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc +++ b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc @@ -9,8 +9,6 @@ #include "base/threading/thread_restrictions.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - MTPDeviceObjectEnumerator::MTPDeviceObjectEnumerator( const MTPDeviceObjectEntries& entries) : object_entries_(entries), @@ -70,5 +68,3 @@ bool MTPDeviceObjectEnumerator::HasMoreEntries() const { bool MTPDeviceObjectEnumerator::IsIndexReadyAndInRange() const { return is_index_ready_ && HasMoreEntries(); } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h index 3287715..32a50b5 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h +++ b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h @@ -14,8 +14,6 @@ #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" #include "webkit/browser/fileapi/file_system_file_util.h" -namespace chrome { - // MTPDeviceObjectEnumerator is used to enumerate the media transfer protocol // (MTP) device objects from a given object entry list. // MTPDeviceObjectEnumerator supports MTP device file operations. @@ -60,6 +58,4 @@ class MTPDeviceObjectEnumerator DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ diff --git a/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc b/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc index 24f5a55..7c2725c 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc +++ b/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc @@ -14,7 +14,6 @@ #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { namespace { struct MTPDeviceObjectEntryData { @@ -91,4 +90,3 @@ TEST_F(MTPDeviceObjectEnumeratorWinTest, Traversal) { } } // namespace -} // namespace chrome
\ No newline at end of file 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 cb59d1a..0d9ac6c1 100644 --- a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc +++ b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc @@ -22,8 +22,6 @@ #include "chrome/common/chrome_constants.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace media_transfer_protocol { namespace { @@ -410,5 +408,3 @@ string16 GetObjectIdFromName(IPortableDevice* device, } } // namespace media_transfer_protocol - -} // namespace chrome diff --git a/chrome/browser/media_galleries/win/mtp_device_operations_util.h b/chrome/browser/media_galleries/win/mtp_device_operations_util.h index ca556df..d11de86 100644 --- a/chrome/browser/media_galleries/win/mtp_device_operations_util.h +++ b/chrome/browser/media_galleries/win/mtp_device_operations_util.h @@ -20,8 +20,6 @@ #include "base/win/scoped_comptr.h" #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" -namespace chrome { - namespace media_transfer_protocol { // Opens the device for communication. |pnp_device_id| specifies the plug and @@ -81,6 +79,4 @@ string16 GetObjectIdFromName(IPortableDevice* device, } // namespace media_transfer_protocol -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OPERATIONS_UTIL_H_ diff --git a/chrome/browser/media_galleries/win/portable_device_map_service.cc b/chrome/browser/media_galleries/win/portable_device_map_service.cc index 986d8f4..557353e 100644 --- a/chrome/browser/media_galleries/win/portable_device_map_service.cc +++ b/chrome/browser/media_galleries/win/portable_device_map_service.cc @@ -9,8 +9,6 @@ #include "base/threading/thread_restrictions.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace { base::LazyInstance<PortableDeviceMapService> g_portable_device_map_service = @@ -78,5 +76,3 @@ PortableDeviceMapService::PortableDeviceMapService() { PortableDeviceMapService::~PortableDeviceMapService() { } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/win/portable_device_map_service.h b/chrome/browser/media_galleries/win/portable_device_map_service.h index 41671c6..01a5900 100644 --- a/chrome/browser/media_galleries/win/portable_device_map_service.h +++ b/chrome/browser/media_galleries/win/portable_device_map_service.h @@ -13,8 +13,6 @@ #include "base/synchronization/lock.h" #include "base/win/scoped_comptr.h" -namespace chrome { - // PortableDeviceMapService keeps track of initialized portable device // interfaces. PortableDeviceMapService owns the portable device interfaces. class PortableDeviceMapService { @@ -75,6 +73,4 @@ class PortableDeviceMapService { DISALLOW_COPY_AND_ASSIGN(PortableDeviceMapService); }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_PORTABLE_DEVICE_MAP_SERVICE_H_ diff --git a/chrome/browser/media_galleries/win/snapshot_file_details.cc b/chrome/browser/media_galleries/win/snapshot_file_details.cc index 073c97d..093ef04 100644 --- a/chrome/browser/media_galleries/win/snapshot_file_details.cc +++ b/chrome/browser/media_galleries/win/snapshot_file_details.cc @@ -6,8 +6,6 @@ #include "base/basictypes.h" -namespace chrome { - /////////////////////////////////////////////////////////////////////////////// // SnapshotRequestInfo // /////////////////////////////////////////////////////////////////////////////// @@ -67,5 +65,3 @@ bool SnapshotFileDetails::AddBytesWritten(DWORD bytes_written) { bytes_written_ += bytes_written; return true; } - -} // namespace chrome diff --git a/chrome/browser/media_galleries/win/snapshot_file_details.h b/chrome/browser/media_galleries/win/snapshot_file_details.h index 7c39ea3..f9e4dba 100644 --- a/chrome/browser/media_galleries/win/snapshot_file_details.h +++ b/chrome/browser/media_galleries/win/snapshot_file_details.h @@ -10,8 +10,6 @@ #include "base/win/scoped_comptr.h" #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" -namespace chrome { - // Structure used to represent snapshot file request params. struct SnapshotRequestInfo { SnapshotRequestInfo( @@ -92,6 +90,4 @@ class SnapshotFileDetails { DWORD bytes_written_; }; -} // namespace chrome - #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_SNAPSHOT_FILE_DETAILS_H_ diff --git a/chrome/browser/storage_monitor/image_capture_device_manager.h b/chrome/browser/storage_monitor/image_capture_device_manager.h index a1d0ea1..cfb1aca 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager.h +++ b/chrome/browser/storage_monitor/image_capture_device_manager.h @@ -15,8 +15,6 @@ @class ImageCaptureDevice; @class ImageCaptureDeviceManagerImpl; -namespace chrome { - // Upon creation, begins monitoring for any attached devices using the // ImageCapture API. Notifies clients of the presence of such devices // (i.e. cameras, USB cards) using the SystemMonitor and makes them @@ -47,6 +45,4 @@ class ImageCaptureDeviceManager { base::scoped_nsobject<ImageCaptureDeviceManagerImpl> device_browser_; }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_ diff --git a/chrome/browser/storage_monitor/image_capture_device_manager.mm b/chrome/browser/storage_monitor/image_capture_device_manager.mm index 28e2518..a6daed5 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager.mm +++ b/chrome/browser/storage_monitor/image_capture_device_manager.mm @@ -12,7 +12,7 @@ namespace { -chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; +ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; } // namespace @@ -31,10 +31,10 @@ chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; // Guaranteed to outlive this class. // TODO(gbillock): Update when ownership chains go up through // a StorageMonitor subclass. - chrome::StorageMonitor::Receiver* notifications_; + StorageMonitor::Receiver* notifications_; } -- (void)setNotifications:(chrome::StorageMonitor::Receiver*)notifications; +- (void)setNotifications:(StorageMonitor::Receiver*)notifications; - (void)close; // The UUIDs passed here are available in the device attach notifications. @@ -59,7 +59,7 @@ chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; return self; } -- (void)setNotifications:(chrome::StorageMonitor::Receiver*)notifications { +- (void)setNotifications:(StorageMonitor::Receiver*)notifications { notifications_ = notifications; } @@ -98,9 +98,9 @@ chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; [cameras_ addObject:addedDevice]; // TODO(gbillock): use [cameraDevice mountPoint] here when possible. - chrome::StorageInfo info( - chrome::StorageInfo::MakeDeviceId( - chrome::StorageInfo::MAC_IMAGE_CAPTURE, + StorageInfo info( + StorageInfo::MakeDeviceId( + StorageInfo::MAC_IMAGE_CAPTURE, base::SysNSStringToUTF8([cameraDevice UUIDString])), base::SysNSStringToUTF16([cameraDevice name]), "", @@ -123,14 +123,11 @@ chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; [cameras_ removeObject:device]; notifications_->ProcessDetach( - chrome::StorageInfo::MakeDeviceId( - chrome::StorageInfo::MAC_IMAGE_CAPTURE, uuid)); + StorageInfo::MakeDeviceId(StorageInfo::MAC_IMAGE_CAPTURE, uuid)); } @end // ImageCaptureDeviceManagerImpl -namespace chrome { - ImageCaptureDeviceManager::ImageCaptureDeviceManager() { device_browser_.reset([[ImageCaptureDeviceManagerImpl alloc] init]); g_image_capture_device_manager = this; @@ -167,5 +164,3 @@ ImageCaptureDevice* ImageCaptureDeviceManager::deviceForUUID( id<ICDeviceBrowserDelegate> ImageCaptureDeviceManager::device_browser() { return device_browser_.get(); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm index 1918368..503cb27 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm +++ b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm @@ -259,15 +259,14 @@ class ImageCaptureDeviceManagerTest : public testing::Test { ui_thread_.reset(new content::TestBrowserThread( content::BrowserThread::UI, &message_loop_)); - monitor_ = chrome::test::TestStorageMonitor::CreateAndInstall(); + monitor_ = TestStorageMonitor::CreateAndInstall(); } virtual void TearDown() OVERRIDE { - chrome::test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); } - MockICCameraDevice* AttachDevice( - chrome::ImageCaptureDeviceManager* manager) { + MockICCameraDevice* AttachDevice(ImageCaptureDeviceManager* manager) { // Ownership will be passed to the device browser delegate. base::scoped_nsobject<MockICCameraDevice> device( [[MockICCameraDevice alloc] init]); @@ -276,7 +275,7 @@ class ImageCaptureDeviceManagerTest : public testing::Test { return device.autorelease(); } - void DetachDevice(chrome::ImageCaptureDeviceManager* manager, + void DetachDevice(ImageCaptureDeviceManager* manager, ICCameraDevice* device) { id<ICDeviceBrowserDelegate> delegate = manager->device_browser(); [delegate deviceBrowser:nil didRemoveDevice:device moreGoing:NO]; @@ -286,16 +285,15 @@ class ImageCaptureDeviceManagerTest : public testing::Test { base::MessageLoopForUI message_loop_; scoped_ptr<content::TestBrowserThread> ui_thread_; - chrome::test::TestStorageMonitor* monitor_; + TestStorageMonitor* monitor_; TestCameraListener listener_; }; TEST_F(ImageCaptureDeviceManagerTest, TestAttachDetach) { - chrome::ImageCaptureDeviceManager manager; + ImageCaptureDeviceManager manager; manager.SetNotifications(monitor_->receiver()); ICCameraDevice* device = AttachDevice(&manager); - std::vector<chrome::StorageInfo> devices = - monitor_->GetAllAvailableStorages(); + std::vector<StorageInfo> devices = monitor_->GetAllAvailableStorages(); ASSERT_EQ(1U, devices.size()); EXPECT_EQ(std::string("ic:") + kDeviceId, devices[0].device_id()); @@ -306,15 +304,15 @@ TEST_F(ImageCaptureDeviceManagerTest, TestAttachDetach) { }; TEST_F(ImageCaptureDeviceManagerTest, OpenCamera) { - chrome::ImageCaptureDeviceManager manager; + ImageCaptureDeviceManager manager; manager.SetNotifications(monitor_->receiver()); ICCameraDevice* device = AttachDevice(&manager); - EXPECT_FALSE(chrome::ImageCaptureDeviceManager::deviceForUUID( + EXPECT_FALSE(ImageCaptureDeviceManager::deviceForUUID( "nonexistent")); base::scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); + [ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; @@ -337,17 +335,16 @@ TEST_F(ImageCaptureDeviceManagerTest, OpenCamera) { [camera close]; DetachDevice(&manager, device); - EXPECT_FALSE(chrome::ImageCaptureDeviceManager::deviceForUUID( - kDeviceId)); + EXPECT_FALSE(ImageCaptureDeviceManager::deviceForUUID(kDeviceId)); } TEST_F(ImageCaptureDeviceManagerTest, RemoveCamera) { - chrome::ImageCaptureDeviceManager manager; + ImageCaptureDeviceManager manager; manager.SetNotifications(monitor_->receiver()); ICCameraDevice* device = AttachDevice(&manager); base::scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); + [ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; @@ -361,12 +358,12 @@ TEST_F(ImageCaptureDeviceManagerTest, DownloadFile) { new content::TestBrowserThread( content::BrowserThread::FILE, &message_loop_)); - chrome::ImageCaptureDeviceManager manager; + ImageCaptureDeviceManager manager; manager.SetNotifications(monitor_->receiver()); MockICCameraDevice* device = AttachDevice(&manager); base::scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); + [ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; @@ -417,12 +414,12 @@ TEST_F(ImageCaptureDeviceManagerTest, TestSubdirectories) { new content::TestBrowserThread( content::BrowserThread::FILE, &message_loop_)); - chrome::ImageCaptureDeviceManager manager; + ImageCaptureDeviceManager manager; manager.SetNotifications(monitor_->receiver()); MockICCameraDevice* device = AttachDevice(&manager); base::scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); + [ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; diff --git a/chrome/browser/storage_monitor/media_storage_util.cc b/chrome/browser/storage_monitor/media_storage_util.cc index aef5b0b..9df6f92 100644 --- a/chrome/browser/storage_monitor/media_storage_util.cc +++ b/chrome/browser/storage_monitor/media_storage_util.cc @@ -18,8 +18,6 @@ using content::BrowserThread; -namespace chrome { - namespace { // MediaDeviceNotification.DeviceInfo histogram values. @@ -251,5 +249,3 @@ bool MediaStorageUtil::IsRemovableStorageAttached(const std::string& id) { } return false; } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/media_storage_util.h b/chrome/browser/storage_monitor/media_storage_util.h index c627403..3c68200 100644 --- a/chrome/browser/storage_monitor/media_storage_util.h +++ b/chrome/browser/storage_monitor/media_storage_util.h @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// chrome::MediaStorageUtil provides information about storage devices attached +// MediaStorageUtil provides information about storage devices attached // to the computer. #ifndef CHROME_BROWSER_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ @@ -15,8 +15,6 @@ #include "base/callback_forward.h" #include "base/files/file_path.h" -namespace chrome { - struct StorageInfo; class MediaStorageUtil { @@ -65,6 +63,4 @@ class MediaStorageUtil { DISALLOW_IMPLICIT_CONSTRUCTORS(MediaStorageUtil); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ diff --git a/chrome/browser/storage_monitor/media_storage_util_unittest.cc b/chrome/browser/storage_monitor/media_storage_util_unittest.cc index a07260b..03114c3 100644 --- a/chrome/browser/storage_monitor/media_storage_util_unittest.cc +++ b/chrome/browser/storage_monitor/media_storage_util_unittest.cc @@ -18,8 +18,6 @@ #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - namespace { const char kImageCaptureDeviceId[] = "ic:xyz"; @@ -63,14 +61,14 @@ class MediaStorageUtilTest : public testing::Test { } virtual void SetUp() OVERRIDE { - monitor_ = chrome::test::TestStorageMonitor::CreateAndInstall(); + monitor_ = TestStorageMonitor::CreateAndInstall(); ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); file_thread_.Start(); } virtual void TearDown() OVERRIDE { WaitForFileThread(); - chrome::test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); } static void PostQuitToUIThread() { @@ -89,7 +87,7 @@ class MediaStorageUtilTest : public testing::Test { base::MessageLoop message_loop_; private: - chrome::test::TestStorageMonitor* monitor_; + TestStorageMonitor* monitor_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; base::ScopedTempDir scoped_temp_dir_; @@ -155,5 +153,3 @@ TEST_F(MediaStorageUtilTest, DetectDeviceFiltered) { EXPECT_TRUE(devices.find(kImageCaptureDeviceId) != devices.end()); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc index afb9a78..15d3369 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc +++ b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc @@ -15,8 +15,6 @@ #include "chrome/browser/storage_monitor/removable_device_constants.h" #include "device/media_transfer_protocol/mtp_storage_info.pb.h" -namespace chrome { - namespace { // Device root path constant. @@ -238,5 +236,3 @@ bool MediaTransferProtocolDeviceObserverLinux::GetLocationForDeviceId( return false; } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h index 36cda99..8ab567a 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h +++ b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h @@ -16,8 +16,6 @@ namespace base { class FilePath; } -namespace chrome { - // Gets the mtp device information given a |storage_name|. On success, // fills in |id|, |name| and |location|. typedef void (*GetStorageInfoFunc)( @@ -87,6 +85,4 @@ class MediaTransferProtocolDeviceObserverLinux DISALLOW_COPY_AND_ASSIGN(MediaTransferProtocolDeviceObserverLinux); }; -} // namespace chrome - #endif // CHROME_BROWSER_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/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc index 78471c6..f0c1136 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc +++ b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc @@ -22,8 +22,6 @@ #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - namespace { // Sample mtp device storage information. @@ -98,8 +96,7 @@ class MediaTransferProtocolDeviceObserverLinuxTest : public testing::Test { protected: virtual void SetUp() OVERRIDE { mock_storage_observer_.reset(new MockRemovableStorageObserver); - chrome::test::TestStorageMonitor* monitor = - chrome::test::TestStorageMonitor::CreateAndInstall(); + TestStorageMonitor* monitor = TestStorageMonitor::CreateAndInstall(); mtp_device_observer_.reset( new TestMediaTransferProtocolDeviceObserverLinux( monitor->receiver(), monitor->media_transfer_protocol_manager())); @@ -110,7 +107,7 @@ class MediaTransferProtocolDeviceObserverLinuxTest : public testing::Test { StorageMonitor* monitor = g_browser_process->storage_monitor(); monitor->RemoveObserver(mock_storage_observer_.get()); mtp_device_observer_.reset(); - chrome::test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); } // Returns the device changed observer object. @@ -166,5 +163,3 @@ TEST_F(MediaTransferProtocolDeviceObserverLinuxTest, StorageWithInvalidInfo) { EXPECT_EQ(0, observer().attach_calls()); EXPECT_EQ(0, observer().detach_calls()); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/mock_removable_storage_observer.cc b/chrome/browser/storage_monitor/mock_removable_storage_observer.cc index ba679de..bf8e940 100644 --- a/chrome/browser/storage_monitor/mock_removable_storage_observer.cc +++ b/chrome/browser/storage_monitor/mock_removable_storage_observer.cc @@ -4,8 +4,6 @@ #include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" -namespace chrome { - MockRemovableStorageObserver::MockRemovableStorageObserver() : attach_calls_(0), detach_calls_(0) { } @@ -24,5 +22,3 @@ void MockRemovableStorageObserver::OnRemovableStorageDetached( detach_calls_++; last_detached_ = info; } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/mock_removable_storage_observer.h b/chrome/browser/storage_monitor/mock_removable_storage_observer.h index 524b784..ba9eeb1 100644 --- a/chrome/browser/storage_monitor/mock_removable_storage_observer.h +++ b/chrome/browser/storage_monitor/mock_removable_storage_observer.h @@ -8,8 +8,6 @@ #include "chrome/browser/storage_monitor/removable_storage_observer.h" #include "chrome/browser/storage_monitor/storage_info.h" -namespace chrome { - class MockRemovableStorageObserver : public RemovableStorageObserver { public: MockRemovableStorageObserver(); @@ -38,6 +36,4 @@ class MockRemovableStorageObserver : public RemovableStorageObserver { StorageInfo last_detached_; }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ diff --git a/chrome/browser/storage_monitor/mtab_watcher_linux.cc b/chrome/browser/storage_monitor/mtab_watcher_linux.cc index 9d72d9b..225d45b 100644 --- a/chrome/browser/storage_monitor/mtab_watcher_linux.cc +++ b/chrome/browser/storage_monitor/mtab_watcher_linux.cc @@ -12,8 +12,6 @@ #include "base/bind.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace { // List of file systems we care about. @@ -101,5 +99,3 @@ void MtabWatcherLinux::OnFilePathChanged( ReadMtab(); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/mtab_watcher_linux.h b/chrome/browser/storage_monitor/mtab_watcher_linux.h index 811236a..cc4140d 100644 --- a/chrome/browser/storage_monitor/mtab_watcher_linux.h +++ b/chrome/browser/storage_monitor/mtab_watcher_linux.h @@ -20,8 +20,6 @@ #include "base/files/file_path_watcher.h" #include "base/memory/weak_ptr.h" -namespace chrome { - class MtabWatcherLinux { public: // (mount point, mount device) @@ -61,6 +59,4 @@ class MtabWatcherLinux { DISALLOW_COPY_AND_ASSIGN(MtabWatcherLinux); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ diff --git a/chrome/browser/storage_monitor/portable_device_watcher_win.cc b/chrome/browser/storage_monitor/portable_device_watcher_win.cc index efa5b2c..6be6d209 100644 --- a/chrome/browser/storage_monitor/portable_device_watcher_win.cc +++ b/chrome/browser/storage_monitor/portable_device_watcher_win.cc @@ -25,8 +25,6 @@ #include "chrome/browser/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace { // Name of the client application that communicates with the MTP device. @@ -562,12 +560,12 @@ void PortableDeviceWatcherWin::EjectDevice( string16 storage_object_id; if (!GetMTPStorageInfoFromDeviceId(device_id, &device_location, &storage_object_id)) { - callback.Run(chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE); + callback.Run(StorageMonitor::EJECT_NO_SUCH_DEVICE); return; } HandleDeviceDetachEvent(device_location); - callback.Run(chrome::StorageMonitor::EJECT_OK); + callback.Run(StorageMonitor::EJECT_OK); } void PortableDeviceWatcherWin::EnumerateAttachedDevices() { @@ -667,5 +665,3 @@ void PortableDeviceWatcherWin::HandleDeviceDetachEvent( } device_map_.erase(device_iter); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/portable_device_watcher_win.h b/chrome/browser/storage_monitor/portable_device_watcher_win.h index 44cd80ecd..3bb6cee 100644 --- a/chrome/browser/storage_monitor/portable_device_watcher_win.h +++ b/chrome/browser/storage_monitor/portable_device_watcher_win.h @@ -20,11 +20,7 @@ namespace base { class SequencedTaskRunner; } -namespace chrome { - -namespace test { class TestPortableDeviceWatcherWin; -} // This class watches the portable device mount points and sends notifications // about the attached/detached media transfer protocol (MTP) devices. @@ -98,7 +94,7 @@ class PortableDeviceWatcherWin { base::Callback<void(StorageMonitor::EjectStatus)> callback); private: - friend class test::TestPortableDeviceWatcherWin; + friend class TestPortableDeviceWatcherWin; // Key: MTP device storage unique id. // Value: Metadata for the given storage. @@ -143,6 +139,4 @@ class PortableDeviceWatcherWin { DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ diff --git a/chrome/browser/storage_monitor/removable_device_constants.cc b/chrome/browser/storage_monitor/removable_device_constants.cc index a144cc9..0daddff 100644 --- a/chrome/browser/storage_monitor/removable_device_constants.cc +++ b/chrome/browser/storage_monitor/removable_device_constants.cc @@ -4,8 +4,6 @@ #include "chrome/browser/storage_monitor/removable_device_constants.h" -namespace chrome { - const char kFSUniqueIdPrefix[] = "UUID:"; const char kVendorModelSerialPrefix[] = "VendorModelSerial:"; @@ -18,5 +16,3 @@ const char16 kWPDDevInterfaceGUID[] = L"{6ac27878-a6fa-4155-ba85-f98f491d4f33}"; #endif const base::FilePath::CharType kDCIMDirectoryName[] = FILE_PATH_LITERAL("DCIM"); - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/removable_device_constants.h b/chrome/browser/storage_monitor/removable_device_constants.h index c63587a..a7d9363 100644 --- a/chrome/browser/storage_monitor/removable_device_constants.h +++ b/chrome/browser/storage_monitor/removable_device_constants.h @@ -9,8 +9,6 @@ #include "base/strings/string16.h" #include "build/build_config.h" -namespace chrome { - // Prefix constants used in device unique id. extern const char kFSUniqueIdPrefix[]; extern const char kVendorModelSerialPrefix[]; @@ -26,6 +24,4 @@ extern const char16 kWPDDevInterfaceGUID[]; extern const base::FilePath::CharType kDCIMDirectoryName[]; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_DEVICE_CONSTANTS_H_ diff --git a/chrome/browser/storage_monitor/removable_storage_observer.h b/chrome/browser/storage_monitor/removable_storage_observer.h index 8590e21..b458684 100644 --- a/chrome/browser/storage_monitor/removable_storage_observer.h +++ b/chrome/browser/storage_monitor/removable_storage_observer.h @@ -7,8 +7,6 @@ #include "chrome/browser/storage_monitor/storage_info.h" -namespace chrome { - // Clients use this class to register for event-based notifications of // removable storage devices attached to or removed from the system. class RemovableStorageObserver { @@ -25,6 +23,4 @@ class RemovableStorageObserver { virtual ~RemovableStorageObserver() {} }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_REMOVABLE_STORAGE_OBSERVER_H_ diff --git a/chrome/browser/storage_monitor/storage_info.cc b/chrome/browser/storage_monitor/storage_info.cc index f286720..3fc66c0 100644 --- a/chrome/browser/storage_monitor/storage_info.cc +++ b/chrome/browser/storage_monitor/storage_info.cc @@ -6,8 +6,6 @@ #include "base/logging.h" -namespace chrome { - namespace { // Prefix constants for different device id spaces. @@ -141,5 +139,3 @@ bool StorageInfo::IsPicasaDevice(const std::string& device_id) { Type type; return CrackDeviceId(device_id, &type, NULL) && type == PICASA; } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_info.h b/chrome/browser/storage_monitor/storage_info.h index 907b2a9..56f9d52 100644 --- a/chrome/browser/storage_monitor/storage_info.h +++ b/chrome/browser/storage_monitor/storage_info.h @@ -8,8 +8,6 @@ #include "base/files/file_path.h" #include "base/strings/string16.h" -namespace chrome { - struct StorageInfo { public: enum Type { @@ -110,6 +108,4 @@ struct StorageInfo { uint64 total_size_in_bytes_; }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_ diff --git a/chrome/browser/storage_monitor/storage_info_unittest.cc b/chrome/browser/storage_monitor/storage_info_unittest.cc index b29cc50..36229c5 100644 --- a/chrome/browser/storage_monitor/storage_info_unittest.cc +++ b/chrome/browser/storage_monitor/storage_info_unittest.cc @@ -11,8 +11,6 @@ const char kMtpDeviceId[] = "mtp:VendorModelSerial:ABC:1233:1237912873"; const char kUniqueId[] = "VendorModelSerial:ABC:1233:1237912873"; const char kImageCaptureDeviceId[] = "ic:xyz"; -namespace chrome { - // Test to verify |MakeDeviceId| functionality using a sample // mtp device unique id. TEST(StorageInfoTest, MakeMtpDeviceId) { @@ -32,11 +30,9 @@ TEST(StorageInfoTest, CrackMtpDeviceId) { } TEST(StorageInfoTest, TestImageCaptureDeviceId) { - chrome::StorageInfo::Type type; + StorageInfo::Type type; std::string id; ASSERT_TRUE(StorageInfo::CrackDeviceId(kImageCaptureDeviceId, &type, &id)); EXPECT_EQ(StorageInfo::MAC_IMAGE_CAPTURE, type); EXPECT_EQ("xyz", id); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor.cc b/chrome/browser/storage_monitor/storage_monitor.cc index 10d043e6..0d5ff1e 100644 --- a/chrome/browser/storage_monitor/storage_monitor.cc +++ b/chrome/browser/storage_monitor/storage_monitor.cc @@ -10,8 +10,6 @@ #include "chrome/browser/storage_monitor/removable_storage_observer.h" #include "chrome/browser/storage_monitor/transient_device_ids.h" -namespace chrome { - StorageMonitor::Receiver::~Receiver() { } @@ -174,5 +172,3 @@ void StorageMonitor::ProcessDetach(const std::string& id) { &RemovableStorageObserver::OnRemovableStorageDetached, info); } } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor.h b/chrome/browser/storage_monitor/storage_monitor.h index a11596b..6647cbf 100644 --- a/chrome/browser/storage_monitor/storage_monitor.h +++ b/chrome/browser/storage_monitor/storage_monitor.h @@ -17,23 +17,18 @@ #include "base/threading/thread_checker.h" #include "chrome/browser/storage_monitor/storage_info.h" -class ChromeBrowserMainPartsLinux; -class ChromeBrowserMainPartsMac; +class MediaFileSystemRegistryTest; class MediaGalleriesPlatformAppBrowserTest; class MediaGalleriesPrivateApiTest; +class RemovableStorageObserver; class SystemStorageApiTest; class SystemStorageEjectApiTest; +class TransientDeviceIds; namespace device { class MediaTransferProtocolManager; } -namespace chrome { - -class MediaFileSystemRegistryTest; -class RemovableStorageObserver; -class TransientDeviceIds; - // Base class for platform-specific instances watching for removable storage // attachments/detachments. // Lifecycle contracts: This class is created in the browser process @@ -134,9 +129,9 @@ class StorageMonitor { base::Callback<void(EjectStatus)> callback); protected: + friend class ::MediaFileSystemRegistryTest; friend class ::MediaGalleriesPlatformAppBrowserTest; friend class ::MediaGalleriesPrivateApiTest; - friend class MediaFileSystemRegistryTest; friend class ::SystemStorageApiTest; friend class ::SystemStorageEjectApiTest; @@ -182,6 +177,4 @@ class StorageMonitor { scoped_ptr<TransientDeviceIds> transient_device_ids_; }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc index f8a99fc..89ab745 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc +++ b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc @@ -28,7 +28,7 @@ namespace { std::string MakeDeviceUniqueId(const disks::DiskMountManager::Disk& disk) { std::string uuid = disk.fs_uuid(); if (!uuid.empty()) - return chrome::kFSUniqueIdPrefix + uuid; + return kFSUniqueIdPrefix + uuid; // If one of the vendor or product information is missing, its value in the // string is empty. @@ -39,14 +39,14 @@ std::string MakeDeviceUniqueId(const disks::DiskMountManager::Disk& disk) { const std::string& product = disk.product_id(); if (vendor.empty() && product.empty()) return std::string(); - return chrome::kVendorModelSerialPrefix + vendor + ":" + product + ":"; + return kVendorModelSerialPrefix + vendor + ":" + product + ":"; } // Returns true if the requested device is valid, else false. On success, fills // in |info|. bool GetDeviceInfo(const disks::DiskMountManager::MountPointInfo& mount_info, bool has_dcim, - chrome::StorageInfo* info) { + StorageInfo* info) { DCHECK(info); std::string source_path = mount_info.source_path; @@ -59,23 +59,21 @@ bool GetDeviceInfo(const disks::DiskMountManager::MountPointInfo& mount_info, // Keep track of device uuid and label, to see how often we receive empty // values. string16 device_label = UTF8ToUTF16(disk->device_label()); - chrome::MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, - device_label); + MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, device_label); if (unique_id.empty()) return false; - chrome::StorageInfo::Type type = has_dcim ? - chrome::StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM : - chrome::StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; - - *info = chrome::StorageInfo( - chrome::StorageInfo::MakeDeviceId(type, unique_id), - string16(), - mount_info.mount_path, - device_label, - UTF8ToUTF16(disk->vendor_name()), - UTF8ToUTF16(disk->product_name()), - disk->total_size_in_bytes()); + StorageInfo::Type type = has_dcim ? + StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM : + StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; + + *info = StorageInfo(StorageInfo::MakeDeviceId(type, unique_id), + string16(), + mount_info.mount_path, + device_label, + UTF8ToUTF16(disk->vendor_name()), + UTF8ToUTF16(disk->product_name()), + disk->total_size_in_bytes()); return true; } @@ -83,14 +81,12 @@ bool GetDeviceInfo(const disks::DiskMountManager::MountPointInfo& mount_info, bool CheckMountedPathOnFileThread( const disks::DiskMountManager::MountPointInfo& mount_info) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); - return chrome::MediaStorageUtil::HasDcim( - base::FilePath(mount_info.mount_path)); + return MediaStorageUtil::HasDcim(base::FilePath(mount_info.mount_path)); } } // namespace using content::BrowserThread; -using chrome::StorageInfo; StorageMonitorCros::StorageMonitorCros() : weak_ptr_factory_(this) { @@ -115,7 +111,7 @@ void StorageMonitorCros::Init() { } media_transfer_protocol_device_observer_.reset( - new chrome::MediaTransferProtocolDeviceObserverLinux( + new MediaTransferProtocolDeviceObserverLinux( receiver(), media_transfer_protocol_manager_.get())); } @@ -236,12 +232,12 @@ bool StorageMonitorCros::GetStorageInfoForPath( // Callback executed when the unmount call is run by DiskMountManager. // Forwards result to |EjectDevice| caller. void NotifyUnmountResult( - base::Callback<void(chrome::StorageMonitor::EjectStatus)> callback, + base::Callback<void(StorageMonitor::EjectStatus)> callback, chromeos::MountError error_code) { if (error_code == MOUNT_ERROR_NONE) - callback.Run(chrome::StorageMonitor::EJECT_OK); + callback.Run(StorageMonitor::EJECT_OK); else - callback.Run(chrome::StorageMonitor::EJECT_FAILURE); + callback.Run(StorageMonitor::EJECT_FAILURE); } void StorageMonitorCros::EjectDevice( @@ -297,7 +293,7 @@ void StorageMonitorCros::AddMountedPath( } // Get the media device uuid and label if exists. - chrome::StorageInfo info; + StorageInfo info; if (!GetDeviceInfo(mount_info, has_dcim, &info)) return; @@ -311,10 +307,6 @@ void StorageMonitorCros::AddMountedPath( } // namespace chromeos -namespace chrome { - StorageMonitor* StorageMonitor::Create() { return new chromeos::StorageMonitorCros(); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos.h b/chrome/browser/storage_monitor/storage_monitor_chromeos.h index bd40f3e..048a3aef 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos.h +++ b/chrome/browser/storage_monitor/storage_monitor_chromeos.h @@ -23,13 +23,11 @@ #include "chrome/browser/storage_monitor/storage_monitor.h" #include "chromeos/disks/disk_mount_manager.h" -namespace chrome { class MediaTransferProtocolDeviceObserverLinux; -} namespace chromeos { -class StorageMonitorCros : public chrome::StorageMonitor, +class StorageMonitorCros : public StorageMonitor, public disks::DiskMountManager::Observer { public: // Should only be called by browser start up code. @@ -59,9 +57,8 @@ class StorageMonitorCros : public chrome::StorageMonitor, const std::string& device_path) OVERRIDE; // StorageMonitor implementation. - virtual bool GetStorageInfoForPath( - const base::FilePath& path, - chrome::StorageInfo* device_info) const OVERRIDE; + virtual bool GetStorageInfoForPath(const base::FilePath& path, + StorageInfo* device_info) const OVERRIDE; virtual void EjectDevice( const std::string& device_id, base::Callback<void(EjectStatus)> callback) OVERRIDE; @@ -70,7 +67,7 @@ class StorageMonitorCros : public chrome::StorageMonitor, private: // Mapping of mount path to removable mass storage info. - typedef std::map<std::string, chrome::StorageInfo> MountMap; + typedef std::map<std::string, StorageInfo> MountMap; // Helper method that checks existing mount points to see if they are media // devices. Eventually calls AddMountedPath for all mount points. @@ -87,7 +84,7 @@ class StorageMonitorCros : public chrome::StorageMonitor, scoped_ptr<device::MediaTransferProtocolManager> media_transfer_protocol_manager_; - scoped_ptr<chrome::MediaTransferProtocolDeviceObserverLinux> + scoped_ptr<MediaTransferProtocolDeviceObserverLinux> media_transfer_protocol_device_observer_; base::WeakPtrFactory<StorageMonitorCros> weak_ptr_factory_; diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc index f972c87..2ab67a8 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc @@ -54,9 +54,9 @@ uint64 kDevice2SizeInBytes = 212312; uint64 kSDCardSizeInBytes = 9000000; std::string GetDCIMDeviceId(const std::string& unique_id) { - return chrome::StorageInfo::MakeDeviceId( - chrome::StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, - chrome::kFSUniqueIdPrefix + unique_id); + return StorageInfo::MakeDeviceId( + StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, + kFSUniqueIdPrefix + unique_id); } // A test version of StorageMonitorCros that exposes protected methods to tests. @@ -68,7 +68,7 @@ class TestStorageMonitorCros : public StorageMonitorCros { virtual void Init() OVERRIDE { SetMediaTransferProtocolManagerForTest( - new chrome::TestMediaTransferProtocolManagerLinux()); + new TestMediaTransferProtocolManagerLinux()); StorageMonitorCros::Init(); } @@ -79,9 +79,8 @@ class TestStorageMonitorCros : public StorageMonitorCros { StorageMonitorCros::OnMountEvent(event, error_code, mount_info); } - virtual bool GetStorageInfoForPath( - const base::FilePath& path, - chrome::StorageInfo* device_info) const OVERRIDE { + virtual bool GetStorageInfoForPath(const base::FilePath& path, + StorageInfo* device_info) const OVERRIDE { return StorageMonitorCros::GetStorageInfoForPath(path, device_info); } virtual void EjectDevice( @@ -100,7 +99,7 @@ class StorageMonitorCrosTest : public testing::Test { StorageMonitorCrosTest(); virtual ~StorageMonitorCrosTest(); - void EjectNotify(chrome::StorageMonitor::EjectStatus status); + void EjectNotify(StorageMonitor::EjectStatus status); protected: // testing::Test: @@ -131,7 +130,7 @@ class StorageMonitorCrosTest : public testing::Test { static void PostQuitToUIThread(); static void WaitForFileThread(); - chrome::MockRemovableStorageObserver& observer() { + MockRemovableStorageObserver& observer() { return *mock_storage_observer_; } @@ -142,7 +141,7 @@ class StorageMonitorCrosTest : public testing::Test { // Owned by DiskMountManager. disks::MockDiskMountManager* disk_mount_manager_mock_; - chrome::StorageMonitor::EjectStatus status_; + StorageMonitor::EjectStatus status_; private: content::TestBrowserThread ui_thread_; @@ -152,14 +151,14 @@ class StorageMonitorCrosTest : public testing::Test { base::ScopedTempDir scoped_temp_dir_; // Objects that talks with StorageMonitorCros. - scoped_ptr<chrome::MockRemovableStorageObserver> mock_storage_observer_; + scoped_ptr<MockRemovableStorageObserver> mock_storage_observer_; DISALLOW_COPY_AND_ASSIGN(StorageMonitorCrosTest); }; StorageMonitorCrosTest::StorageMonitorCrosTest() : disk_mount_manager_mock_(NULL), - status_(chrome::StorageMonitor::EJECT_FAILURE), + status_(StorageMonitor::EJECT_FAILURE), ui_thread_(BrowserThread::UI, &ui_loop_), file_thread_(BrowserThread::FILE) { } @@ -175,12 +174,12 @@ void StorageMonitorCrosTest::SetUp() { DiskMountManager::InitializeForTesting(disk_mount_manager_mock_); disk_mount_manager_mock_->SetupDefaultReplies(); - mock_storage_observer_.reset(new chrome::MockRemovableStorageObserver); + mock_storage_observer_.reset(new MockRemovableStorageObserver); // Initialize the test subject. - chrome::test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); monitor_ = new TestStorageMonitorCros(); - scoped_ptr<chrome::StorageMonitor> pass_monitor(monitor_); + scoped_ptr<StorageMonitor> pass_monitor(monitor_); TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); DCHECK(browser_process); browser_process->SetStorageMonitor(pass_monitor.Pass()); @@ -229,7 +228,7 @@ void StorageMonitorCrosTest::UnmountDevice( uint64 StorageMonitorCrosTest::GetDeviceStorageSize( const std::string& device_location) { - chrome::StorageInfo info; + StorageInfo info; if (!monitor_->GetStorageInfoForPath(base::FilePath(device_location), &info)) return 0; @@ -242,7 +241,7 @@ base::FilePath StorageMonitorCrosTest::CreateMountPoint( return_path = return_path.AppendASCII(dir); base::FilePath path(return_path); if (with_dcim_dir) - path = path.Append(chrome::kDCIMDirectoryName); + path = path.Append(kDCIMDirectoryName); if (!file_util::CreateDirectory(path)) return base::FilePath(); return return_path; @@ -261,8 +260,7 @@ void StorageMonitorCrosTest::WaitForFileThread() { base::MessageLoop::current()->Run(); } -void StorageMonitorCrosTest::EjectNotify( - chrome::StorageMonitor::EjectStatus status) { +void StorageMonitorCrosTest::EjectNotify(StorageMonitor::EjectStatus status) { status_ = status; } @@ -321,9 +319,9 @@ TEST_F(StorageMonitorCrosTest, NoDCIM) { mount_path.value(), MOUNT_TYPE_DEVICE, disks::MOUNT_CONDITION_NONE); - const std::string device_id = chrome::StorageInfo::MakeDeviceId( - chrome::StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM, - chrome::kFSUniqueIdPrefix + kUniqueId); + const std::string device_id = StorageInfo::MakeDeviceId( + StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM, + kFSUniqueIdPrefix + kUniqueId); MountDevice(MOUNT_ERROR_NONE, mount_info, kUniqueId, kDevice1Name, kVendorName, kProductName, DEVICE_TYPE_USB, kDevice1SizeInBytes); EXPECT_EQ(1, observer().attach_calls()); @@ -484,7 +482,7 @@ TEST_F(StorageMonitorCrosTest, EjectTest) { base::Unretained(this))); ui_loop_.RunUntilIdle(); - EXPECT_EQ(chrome::StorageMonitor::EJECT_OK, status_); + EXPECT_EQ(StorageMonitor::EJECT_OK, status_); } } // namespace diff --git a/chrome/browser/storage_monitor/storage_monitor_linux.cc b/chrome/browser/storage_monitor/storage_monitor_linux.cc index a8096f6..340e479 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux.cc +++ b/chrome/browser/storage_monitor/storage_monitor_linux.cc @@ -27,8 +27,6 @@ #include "chrome/browser/storage_monitor/udev_util_linux.h" #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" -namespace chrome { - using content::BrowserThread; typedef MtabWatcherLinux::MountPointDeviceMap MountPointDeviceMap; @@ -519,5 +517,3 @@ StorageMonitor* StorageMonitor::Create() { const base::FilePath kDefaultMtabPath("/etc/mtab"); return new StorageMonitorLinux(kDefaultMtabPath); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor_linux.h b/chrome/browser/storage_monitor/storage_monitor_linux.h index 1723a2c..18f2cbb 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux.h +++ b/chrome/browser/storage_monitor/storage_monitor_linux.h @@ -28,8 +28,6 @@ #include "chrome/browser/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - class MediaTransferProtocolDeviceObserverLinux; class StorageMonitorLinux : public StorageMonitor, @@ -141,6 +139,4 @@ class StorageMonitorLinux : public StorageMonitor, DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc index 7a74069..8315210 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc @@ -28,8 +28,6 @@ #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - namespace { const char kValidFS[] = "vfat"; @@ -183,7 +181,7 @@ class StorageMonitorLinuxTest : public testing::Test { arraysize(initial_test_data), true /* overwrite */); - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); monitor_ = new TestStorageMonitorLinux(mtab_file_, &message_loop_); scoped_ptr<StorageMonitor> pass_monitor(monitor_); TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); @@ -203,7 +201,7 @@ class StorageMonitorLinuxTest : public testing::Test { base::RunLoop().RunUntilIdle(); // Linux storage monitor must be destroyed on the UI thread, so do it here. - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); base::RunLoop().RunUntilIdle(); } @@ -699,5 +697,3 @@ TEST_F(StorageMonitorLinuxTest, DevicePartitionSize) { } } // namespace - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor_mac.h b/chrome/browser/storage_monitor/storage_monitor_mac.h index e313119..76a0b21 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac.h +++ b/chrome/browser/storage_monitor/storage_monitor_mac.h @@ -12,8 +12,6 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/storage_monitor/storage_monitor.h" -namespace chrome { - class ImageCaptureDeviceManager; // This class posts notifications to listeners when a new disk @@ -66,11 +64,9 @@ class StorageMonitorMac : public StorageMonitor, int pending_disk_updates_; - scoped_ptr<chrome::ImageCaptureDeviceManager> image_capture_device_manager_; + scoped_ptr<ImageCaptureDeviceManager> image_capture_device_manager_; DISALLOW_COPY_AND_ASSIGN(StorageMonitorMac); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_MAC_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_mac.mm b/chrome/browser/storage_monitor/storage_monitor_mac.mm index 370271f..f5ec285 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac.mm +++ b/chrome/browser/storage_monitor/storage_monitor_mac.mm @@ -13,8 +13,6 @@ #include "chrome/browser/storage_monitor/storage_info.h" #include "content/public/browser/browser_thread.h" -namespace chrome { - namespace { const char kDiskImageModelName[] = "Disk Image"; @@ -198,7 +196,7 @@ void StorageMonitorMac::Init() { session_, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); if (base::mac::IsOSLionOrLater()) { - image_capture_device_manager_.reset(new chrome::ImageCaptureDeviceManager); + image_capture_device_manager_.reset(new ImageCaptureDeviceManager); image_capture_device_manager_->SetNotifications(receiver()); } } @@ -385,5 +383,3 @@ bool StorageMonitorMac::FindDiskWithMountPoint( StorageMonitor* StorageMonitor::Create() { return new StorageMonitorMac(); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm index ec3f7ff..0aa5a2c 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm +++ b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm @@ -19,8 +19,6 @@ #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { - uint64 kTestSize = 1000000ULL; namespace { @@ -46,7 +44,7 @@ class StorageMonitorMacTest : public testing::Test { } virtual void SetUp() OVERRIDE { - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); monitor_ = new StorageMonitorMac; scoped_ptr<StorageMonitor> pass_monitor(monitor_); TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); @@ -184,5 +182,3 @@ TEST_F(StorageMonitorMacTest, DMG) { UpdateDisk(info, StorageMonitorMac::UPDATE_DEVICE_ADDED); EXPECT_EQ(0, mock_storage_observer_->attach_calls()); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_unittest.cc index ca85346d..afe0891 100644 --- a/chrome/browser/storage_monitor/storage_monitor_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_unittest.cc @@ -18,11 +18,9 @@ void SetLatch(bool* called) { } // namespace -namespace chrome { - TEST(StorageMonitorTest, TestInitialize) { - test::TestStorageMonitor::RemoveSingleton(); - test::TestStorageMonitor monitor; + TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor monitor; EXPECT_FALSE(monitor.init_called()); bool initialized = false; @@ -34,14 +32,14 @@ TEST(StorageMonitorTest, TestInitialize) { } TEST(StorageMonitorTest, DeviceAttachDetachNotifications) { - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); base::MessageLoop message_loop; const string16 kDeviceName = ASCIIToUTF16("media device"); const std::string kDeviceId1 = "dcim:UUID:FFF0-0001"; const std::string kDeviceId2 = "dcim:UUID:FFF0-0002"; MockRemovableStorageObserver observer1; MockRemovableStorageObserver observer2; - test::TestStorageMonitor monitor; + TestStorageMonitor monitor; monitor.AddObserver(&observer1); monitor.AddObserver(&observer2); @@ -82,17 +80,17 @@ TEST(StorageMonitorTest, DeviceAttachDetachNotifications) { } TEST(StorageMonitorTest, GetAllAvailableStoragesEmpty) { - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); base::MessageLoop message_loop; - test::TestStorageMonitor monitor; + TestStorageMonitor monitor; std::vector<StorageInfo> devices = monitor.GetAllAvailableStorages(); EXPECT_EQ(0U, devices.size()); } TEST(StorageMonitorTest, GetAllAvailableStorageAttachDetach) { - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); base::MessageLoop message_loop; - test::TestStorageMonitor monitor; + TestStorageMonitor monitor; const std::string kDeviceId1 = "dcim:UUID:FFF0-0042"; const string16 kDeviceName1 = ASCIIToUTF16("test"); const base::FilePath kDevicePath1(FILE_PATH_LITERAL("/testfoo")); @@ -135,5 +133,3 @@ TEST(StorageMonitorTest, GetAllAvailableStorageAttachDetach) { devices = monitor.GetAllAvailableStorages(); EXPECT_EQ(0U, devices.size()); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor_win.cc b/chrome/browser/storage_monitor/storage_monitor_win.cc index f20c71b..67ed23c 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win.cc +++ b/chrome/browser/storage_monitor/storage_monitor_win.cc @@ -14,8 +14,6 @@ #include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" -namespace chrome { - // StorageMonitorWin ------------------------------------------------------- StorageMonitorWin::StorageMonitorWin( @@ -164,5 +162,3 @@ StorageMonitor* StorageMonitor::Create() { return new StorageMonitorWin(new VolumeMountWatcherWin(), new PortableDeviceWatcherWin()); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/storage_monitor_win.h b/chrome/browser/storage_monitor/storage_monitor_win.h index c036fbb..d75b662 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win.h +++ b/chrome/browser/storage_monitor/storage_monitor_win.h @@ -14,13 +14,8 @@ namespace base { class FilePath; } -namespace chrome { - -namespace test { -class TestStorageMonitorWin; -} - class PortableDeviceWatcherWin; +class TestStorageMonitorWin; class VolumeMountWatcherWin; class StorageMonitorWin : public StorageMonitor { @@ -44,7 +39,7 @@ class StorageMonitorWin : public StorageMonitor { private: class PortableDeviceNotifications; - friend class test::TestStorageMonitorWin; + friend class TestStorageMonitorWin; friend StorageMonitor* StorageMonitor::Create(); // To support unit tests, this constructor takes |volume_mount_watcher| and @@ -83,6 +78,4 @@ class StorageMonitorWin : public StorageMonitor { DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ diff --git a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc index c23cb34..5ca71381 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc @@ -27,9 +27,6 @@ #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chrome { -namespace test { - using content::BrowserThread; typedef std::vector<int> DeviceIndices; @@ -88,7 +85,7 @@ StorageMonitorWinTest::~StorageMonitorWinTest() { void StorageMonitorWinTest::SetUp() { ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); volume_mount_watcher_ = new TestVolumeMountWatcherWin; monitor_ = new TestStorageMonitorWin(volume_mount_watcher_, new TestPortableDeviceWatcherWin); @@ -110,11 +107,11 @@ void StorageMonitorWinTest::TearDown() { // Windows storage monitor must be destroyed on the same thread // as construction. - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); } void StorageMonitorWinTest::PreAttachDevices() { - test::TestStorageMonitor::RemoveSingleton(); + TestStorageMonitor::RemoveSingleton(); monitor_ = NULL; volume_mount_watcher_ = new TestVolumeMountWatcherWin; volume_mount_watcher_->SetAttachedDevicesFake(); @@ -559,6 +556,3 @@ TEST_F(StorageMonitorWinTest, GetMTPStorageInfoFromDeviceId) { } DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); } - -} // namespace test -} // namespace chrome diff --git a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc b/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc index e3126f1..b61f7c5 100644 --- a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc +++ b/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.cc @@ -6,8 +6,6 @@ #include "device/media_transfer_protocol/mtp_file_entry.pb.h" -namespace chrome { - TestMediaTransferProtocolManagerLinux:: TestMediaTransferProtocolManagerLinux() {} @@ -86,5 +84,3 @@ void TestMediaTransferProtocolManagerLinux::GetFileInfoById( const GetFileInfoCallback& callback) { callback.Run(MtpFileEntry(), true); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h b/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h index 7e84108..db14aa5 100644 --- a/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h +++ b/chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.h @@ -7,8 +7,6 @@ #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" -namespace chrome { - // A dummy MediaTransferProtocolManager implementation. class TestMediaTransferProtocolManagerLinux : public device::MediaTransferProtocolManager { @@ -56,6 +54,4 @@ class TestMediaTransferProtocolManagerLinux DISALLOW_COPY_AND_ASSIGN(TestMediaTransferProtocolManagerLinux); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_LINUX_H_ diff --git a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc b/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc index aaa1a8a..d9d041a 100644 --- a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc +++ b/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc @@ -10,8 +10,6 @@ #include "base/strings/utf_string_conversions.h" -namespace chrome { -namespace test { namespace { // Sample MTP device storage information. @@ -144,6 +142,3 @@ bool TestPortableDeviceWatcherWin::GetMTPStorageInfoFromDeviceId( return PortableDeviceWatcherWin::GetMTPStorageInfoFromDeviceId( storage_device_id, device_location, storage_object_id); } - -} // namespace test -} // namespace chrome diff --git a/chrome/browser/storage_monitor/test_portable_device_watcher_win.h b/chrome/browser/storage_monitor/test_portable_device_watcher_win.h index 04e4342..125a2bfb 100644 --- a/chrome/browser/storage_monitor/test_portable_device_watcher_win.h +++ b/chrome/browser/storage_monitor/test_portable_device_watcher_win.h @@ -13,9 +13,6 @@ #include "base/strings/string16.h" #include "chrome/browser/storage_monitor/portable_device_watcher_win.h" -namespace chrome { -namespace test { - class TestPortableDeviceWatcherWin : public PortableDeviceWatcherWin { public: // MTP device PnP identifiers. @@ -74,7 +71,4 @@ class TestPortableDeviceWatcherWin : public PortableDeviceWatcherWin { DISALLOW_COPY_AND_ASSIGN(TestPortableDeviceWatcherWin); }; -} // namespace test -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ diff --git a/chrome/browser/storage_monitor/test_storage_monitor.cc b/chrome/browser/storage_monitor/test_storage_monitor.cc index 5967f9a..5ae4698f 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor.cc +++ b/chrome/browser/storage_monitor/test_storage_monitor.cc @@ -16,9 +16,6 @@ #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" #endif -namespace chrome { -namespace test { - TestStorageMonitor::TestStorageMonitor() : StorageMonitor(), init_called_(false) { @@ -131,6 +128,3 @@ void TestStorageMonitor::EjectDevice( ejected_device_ = device_id; callback.Run(EJECT_OK); } - -} // namespace test -} // namespace chrome diff --git a/chrome/browser/storage_monitor/test_storage_monitor.h b/chrome/browser/storage_monitor/test_storage_monitor.h index 157f6d2..e3dcfa6 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor.h +++ b/chrome/browser/storage_monitor/test_storage_monitor.h @@ -9,10 +9,7 @@ #include "chrome/browser/storage_monitor/storage_monitor.h" -namespace chrome { -namespace test { - -class TestStorageMonitor : public chrome::StorageMonitor { +class TestStorageMonitor : public StorageMonitor { public: TestStorageMonitor(); virtual ~TestStorageMonitor(); @@ -80,7 +77,4 @@ class TestStorageMonitor : public chrome::StorageMonitor { #endif }; -} // namespace test -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_H_ diff --git a/chrome/browser/storage_monitor/test_storage_monitor_win.cc b/chrome/browser/storage_monitor/test_storage_monitor_win.cc index e78b5e6..2955aec 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor_win.cc +++ b/chrome/browser/storage_monitor/test_storage_monitor_win.cc @@ -9,9 +9,6 @@ #include "chrome/browser/storage_monitor/test_portable_device_watcher_win.h" #include "chrome/browser/storage_monitor/test_volume_mount_watcher_win.h" -namespace chrome { -namespace test { - TestStorageMonitorWin::TestStorageMonitorWin( TestVolumeMountWatcherWin* volume_mount_watcher, TestPortableDeviceWatcherWin* portable_device_watcher) @@ -35,6 +32,3 @@ TestStorageMonitorWin::volume_mount_watcher() { StorageMonitor::Receiver* TestStorageMonitorWin::receiver() const { return StorageMonitor::receiver(); } - -} // namespace test -} // namespace chrome diff --git a/chrome/browser/storage_monitor/test_storage_monitor_win.h b/chrome/browser/storage_monitor/test_storage_monitor_win.h index f7608eb..9d0702f 100644 --- a/chrome/browser/storage_monitor/test_storage_monitor_win.h +++ b/chrome/browser/storage_monitor/test_storage_monitor_win.h @@ -13,9 +13,6 @@ #include "base/memory/ref_counted.h" #include "chrome/browser/storage_monitor/storage_monitor_win.h" -namespace chrome { -namespace test { - class TestPortableDeviceWatcherWin; class TestVolumeMountWatcherWin; @@ -37,7 +34,4 @@ class TestStorageMonitorWin: public StorageMonitorWin { DISALLOW_COPY_AND_ASSIGN(TestStorageMonitorWin); }; -} // namespace test -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_ diff --git a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc b/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc index 937e08d..d63cfc5 100644 --- a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc +++ b/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc @@ -12,9 +12,6 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/storage_monitor/storage_info.h" -namespace chrome { -namespace test { - namespace { base::FilePath GetTempRoot() { @@ -154,6 +151,3 @@ VolumeMountWatcherWin::GetAttachedDevicesCallbackType void TestVolumeMountWatcherWin::ShutdownWorkerPool() { device_info_worker_pool_->Shutdown(); } - -} // namespace test -} // namespace chrome diff --git a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.h b/chrome/browser/storage_monitor/test_volume_mount_watcher_win.h index f2dcbe6..0ba3887 100644 --- a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.h +++ b/chrome/browser/storage_monitor/test_volume_mount_watcher_win.h @@ -19,9 +19,6 @@ namespace base { class FilePath; } -namespace chrome { -namespace test { - class TestVolumeMountWatcherWin : public VolumeMountWatcherWin { public: TestVolumeMountWatcherWin(); @@ -67,7 +64,4 @@ class TestVolumeMountWatcherWin : public VolumeMountWatcherWin { DISALLOW_COPY_AND_ASSIGN(TestVolumeMountWatcherWin); }; -} // namespace test -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ diff --git a/chrome/browser/storage_monitor/transient_device_ids.cc b/chrome/browser/storage_monitor/transient_device_ids.cc index 850c17c..6027044 100644 --- a/chrome/browser/storage_monitor/transient_device_ids.cc +++ b/chrome/browser/storage_monitor/transient_device_ids.cc @@ -11,8 +11,6 @@ #include "base/stl_util.h" #include "chrome/browser/storage_monitor/storage_info.h" -namespace chrome { - TransientDeviceIds::TransientDeviceIds() {} TransientDeviceIds::~TransientDeviceIds() {} @@ -41,5 +39,3 @@ std::string TransientDeviceIds::DeviceIdFromTransientId( return std::string(); return it->second; } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/transient_device_ids.h b/chrome/browser/storage_monitor/transient_device_ids.h index cf6396f..a0c9a82 100644 --- a/chrome/browser/storage_monitor/transient_device_ids.h +++ b/chrome/browser/storage_monitor/transient_device_ids.h @@ -16,8 +16,6 @@ #include "base/basictypes.h" #include "base/threading/thread_checker.h" -namespace chrome { - class TransientDeviceIds { public: TransientDeviceIds(); @@ -44,6 +42,4 @@ class TransientDeviceIds { DISALLOW_COPY_AND_ASSIGN(TransientDeviceIds); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_TRANSIENT_DEVICE_IDS_H_ diff --git a/chrome/browser/storage_monitor/udev_util_linux.cc b/chrome/browser/storage_monitor/udev_util_linux.cc index c88260c..0231df0 100644 --- a/chrome/browser/storage_monitor/udev_util_linux.cc +++ b/chrome/browser/storage_monitor/udev_util_linux.cc @@ -6,8 +6,6 @@ #include "base/files/file_path.h" -namespace chrome { - void UdevDeleter::operator()(struct udev* udev) { udev_unref(udev); } @@ -35,5 +33,3 @@ bool GetUdevDevicePropertyValueByPath(const base::FilePath& device_path, *result = GetUdevDevicePropertyValue(device.get(), key); return true; } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/udev_util_linux.h b/chrome/browser/storage_monitor/udev_util_linux.h index 308af96..3149756 100644 --- a/chrome/browser/storage_monitor/udev_util_linux.h +++ b/chrome/browser/storage_monitor/udev_util_linux.h @@ -15,8 +15,6 @@ namespace base { class FilePath; } -namespace chrome { - // Deleter for ScopedUdevObject. struct UdevDeleter { void operator()(struct udev* udev); @@ -41,6 +39,4 @@ bool GetUdevDevicePropertyValueByPath(const base::FilePath& device_path, const char* key, std::string* result); -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_ diff --git a/chrome/browser/storage_monitor/volume_mount_watcher_win.cc b/chrome/browser/storage_monitor/volume_mount_watcher_win.cc index a4e19f2..5d0eb71 100644 --- a/chrome/browser/storage_monitor/volume_mount_watcher_win.cc +++ b/chrome/browser/storage_monitor/volume_mount_watcher_win.cc @@ -27,8 +27,6 @@ using content::BrowserThread; -namespace chrome { - namespace { const DWORD kMaxPathBufLen = MAX_PATH + 1; @@ -527,5 +525,3 @@ void VolumeMountWatcherWin::EjectDevice( FROM_HERE, base::Bind(&EjectDeviceInThreadPool, device, callback, task_runner_, 0)); } - -} // namespace chrome diff --git a/chrome/browser/storage_monitor/volume_mount_watcher_win.h b/chrome/browser/storage_monitor/volume_mount_watcher_win.h index 72de81a..955221a 100644 --- a/chrome/browser/storage_monitor/volume_mount_watcher_win.h +++ b/chrome/browser/storage_monitor/volume_mount_watcher_win.h @@ -20,11 +20,7 @@ #include "chrome/browser/storage_monitor/storage_info.h" #include "chrome/browser/storage_monitor/storage_monitor.h" -namespace chrome { - -namespace test { class TestVolumeMountWatcherWin; -} // This class watches the volume mount points and sends notifications to // StorageMonitor about the device attach/detach events. @@ -96,7 +92,7 @@ class VolumeMountWatcherWin { scoped_refptr<base::SequencedTaskRunner> task_runner_; private: - friend class test::TestVolumeMountWatcherWin; + friend class TestVolumeMountWatcherWin; // Key: Mass storage device mount point. // Value: Mass storage device metadata. @@ -120,6 +116,4 @@ class VolumeMountWatcherWin { DISALLOW_COPY_AND_ASSIGN(VolumeMountWatcherWin); }; -} // namespace chrome - #endif // CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h index 54559af..bde8334 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h @@ -14,8 +14,6 @@ @class ConstrainedWindowAlert; @class MediaGalleriesCocoaController; -namespace chrome { - class MediaGalleriesDialogBrowserTest; class MediaGalleriesDialogTest; @@ -94,6 +92,4 @@ class MediaGalleriesDialogCocoa : public ConstrainedWindowMacDelegate, DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogCocoa); }; -} // namespace chrome - #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm index 5e9940c..63b1efa 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm @@ -19,10 +19,10 @@ @interface MediaGalleriesCocoaController : NSObject { @private - chrome::MediaGalleriesDialogCocoa* dialog_; + MediaGalleriesDialogCocoa* dialog_; } -@property(nonatomic, assign) chrome::MediaGalleriesDialogCocoa* dialog; +@property(nonatomic, assign) MediaGalleriesDialogCocoa* dialog; @end @@ -50,8 +50,6 @@ @end -namespace chrome { - namespace { const CGFloat kCheckboxMargin = 10; @@ -359,5 +357,3 @@ MediaGalleriesDialog* MediaGalleriesDialog::Create( [[MediaGalleriesCocoaController alloc] init]); return new MediaGalleriesDialogCocoa(controller, cocoa_controller); } - -} // namespace chrome diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm index 3b65dc2..5c3680f 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm @@ -20,8 +20,6 @@ using ::testing::Return; using ::testing::ReturnRef; using web_modal::WebContentsModalDialogManager; -namespace chrome { - class MediaGalleriesDialogBrowserTest : public InProcessBrowserTest { }; @@ -58,5 +56,3 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesDialogBrowserTest, Close) { test_api.CloseAllDialogs(); EXPECT_FALSE([window isVisible]); } - -} // namespace chrome 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 10911ec..6b3da1f 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 @@ -17,8 +17,6 @@ using ::testing::Return; using ::testing::ReturnPointee; using ::testing::ReturnRef; -namespace chrome { - MediaGalleryPrefInfo MakePrefInfoForTesting(MediaGalleryPrefId pref_id) { MediaGalleryPrefInfo gallery; gallery.pref_id = pref_id; @@ -208,5 +206,3 @@ TEST_F(MediaGalleriesDialogTest, ForgetDeletes) { CGFloat new_container_height = NSHeight([dialog->checkbox_container_ frame]); EXPECT_LT(new_container_height, old_container_height); } - -} // namespace chrome diff --git a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc index aaf3130..065807d 100644 --- a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc @@ -15,8 +15,6 @@ using web_modal::WebContentsModalDialogManager; -namespace chrome { - namespace { // Color used for additional attachment detail text for galleries. @@ -246,5 +244,3 @@ MediaGalleriesDialog* MediaGalleriesDialog::Create( MediaGalleriesDialogController* controller) { return new MediaGalleriesDialogGtk(controller); } - -} // namespace chrome diff --git a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h index 0bc7234..7a1b74f 100644 --- a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h +++ b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h @@ -16,8 +16,6 @@ #include "ui/base/gtk/gtk_signal.h" #include "ui/gfx/scoped_gobject.h" -namespace chrome { - class MediaGalleriesDialogController; class MediaGalleriesDialogTest; @@ -78,6 +76,4 @@ class MediaGalleriesDialogGtk : public MediaGalleriesDialog { DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogGtk); }; -} // namespace chrome - #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_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 45bce66..503b00f 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 @@ -17,8 +17,6 @@ using ::testing::Return; using ::testing::ReturnPointee; using ::testing::ReturnRef; -namespace chrome { - namespace { MediaGalleryPrefInfo MakePrefInfoForTesting(MediaGalleryPrefId id) { @@ -184,5 +182,3 @@ TEST_F(MediaGalleriesDialogTest, ForgetDeletes) { attached_permissions.pop_back(); EXPECT_EQ(1U, dialog.checkbox_map_.size()); } - -} // namespace chrome diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc index 79217185..64f81cd 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc @@ -66,8 +66,6 @@ void ScrollableView::Layout() { } // namespace -namespace chrome { - typedef MediaGalleriesDialogController::GalleryPermissionsVector GalleryPermissionsVector; @@ -368,5 +366,3 @@ MediaGalleriesDialog* MediaGalleriesDialog::Create( MediaGalleriesDialogController* controller) { return new MediaGalleriesDialogViews(controller); } - -} // namespace chrome diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.h b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.h index a6944be..2710f9b 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.h +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.h @@ -18,8 +18,6 @@ class LabelButton; class Widget; } -namespace chrome { - // The media galleries configuration view for Views. It will immediately show // upon construction. class MediaGalleriesDialogViews : public MediaGalleriesDialog, @@ -93,6 +91,4 @@ class MediaGalleriesDialogViews : public MediaGalleriesDialog, DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogViews); }; -} // namespace chrome - #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_DIALOG_VIEWS_H_ diff --git a/chrome/browser/ui/webui/options/media_galleries_handler.cc b/chrome/browser/ui/webui/options/media_galleries_handler.cc index 5e23b40..982aaeb 100644 --- a/chrome/browser/ui/webui/options/media_galleries_handler.cc +++ b/chrome/browser/ui/webui/options/media_galleries_handler.cc @@ -23,10 +23,6 @@ namespace options { -using chrome::MediaGalleriesPreferences; -using chrome::MediaGalleriesPrefInfoMap; -using chrome::MediaGalleryPrefInfo; - MediaGalleriesHandler::MediaGalleriesHandler() : weak_ptr_factory_(this) { } @@ -51,14 +47,14 @@ void MediaGalleriesHandler::GetLocalizedValues(DictionaryValue* values) { } void MediaGalleriesHandler::InitializePage() { - chrome::StorageMonitor::GetInstance()->EnsureInitialized( + StorageMonitor::GetInstance()->EnsureInitialized( base::Bind(&MediaGalleriesHandler::InitializeOnStorageMonitorInit, weak_ptr_factory_.GetWeakPtr())); } void MediaGalleriesHandler::InitializeOnStorageMonitorInit() { Profile* profile = Profile::FromWebUI(web_ui()); - if (!chrome::MediaGalleriesPreferences::APIHasBeenUsed(profile)) + if (!MediaGalleriesPreferences::APIHasBeenUsed(profile)) return; if (pref_change_registrar_.IsEmpty()) { @@ -73,7 +69,7 @@ void MediaGalleriesHandler::InitializeOnStorageMonitorInit() { } void MediaGalleriesHandler::RegisterMessages() { - chrome::StorageMonitor::GetInstance()->EnsureInitialized( + StorageMonitor::GetInstance()->EnsureInitialized( base::Bind(&MediaGalleriesHandler::RegisterOnStorageMonitorInit, weak_ptr_factory_.GetWeakPtr())); } @@ -90,9 +86,9 @@ void MediaGalleriesHandler::RegisterOnStorageMonitorInit() { } void MediaGalleriesHandler::OnGalleriesChanged() { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); Profile* profile = Profile::FromWebUI(web_ui()); - chrome::MediaGalleriesPreferences* preferences = + MediaGalleriesPreferences* preferences = g_browser_process->media_file_system_registry()->GetPreferences(profile); ListValue list; @@ -138,8 +134,8 @@ void MediaGalleriesHandler::HandleForgetGallery(const base::ListValue* args) { return; } - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::MediaGalleriesPreferences* preferences = + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + MediaGalleriesPreferences* preferences = g_browser_process->media_file_system_registry()->GetPreferences( Profile::FromWebUI(web_ui())); preferences->ForgetGalleryById(id); @@ -148,8 +144,8 @@ void MediaGalleriesHandler::HandleForgetGallery(const base::ListValue* args) { void MediaGalleriesHandler::FileSelected(const base::FilePath& path, int index, void* params) { - DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized()); - chrome::MediaGalleriesPreferences* preferences = + DCHECK(StorageMonitor::GetInstance()->IsInitialized()); + MediaGalleriesPreferences* preferences = g_browser_process->media_file_system_registry()->GetPreferences( Profile::FromWebUI(web_ui())); preferences->AddGalleryByPath(path); diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 47e8c2a..977051f 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc @@ -417,7 +417,7 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() { #if !defined(OS_ANDROID) && !defined(OS_IOS) // Do not use the real StorageMonitor for tests, which introduces another // source of variability and potential slowness. - ASSERT_TRUE(chrome::test::TestStorageMonitor::CreateForBrowserTests()); + ASSERT_TRUE(TestStorageMonitor::CreateForBrowserTests()); #endif // Pump any pending events that were created as a result of creating a diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc index 4472e10..4f98468 100644 --- a/chrome/test/base/testing_browser_process.cc +++ b/chrome/test/base/testing_browser_process.cc @@ -327,7 +327,7 @@ BookmarkPromptController* TestingBrowserProcess::bookmark_prompt_controller() { #endif } -chrome::StorageMonitor* TestingBrowserProcess::storage_monitor() { +StorageMonitor* TestingBrowserProcess::storage_monitor() { #if defined(OS_IOS) || defined(OS_ANDROID) NOTIMPLEMENTED(); return NULL; @@ -336,14 +336,13 @@ chrome::StorageMonitor* TestingBrowserProcess::storage_monitor() { #endif } -chrome::MediaFileSystemRegistry* -TestingBrowserProcess::media_file_system_registry() { +MediaFileSystemRegistry* TestingBrowserProcess::media_file_system_registry() { #if defined(OS_IOS) || defined(OS_ANDROID) NOTIMPLEMENTED(); return NULL; #else if (!media_file_system_registry_) - media_file_system_registry_.reset(new chrome::MediaFileSystemRegistry()); + media_file_system_registry_.reset(new MediaFileSystemRegistry()); return media_file_system_registry_.get(); #endif } @@ -416,7 +415,7 @@ void TestingBrowserProcess::SetSafeBrowsingService( } void TestingBrowserProcess::SetStorageMonitor( - scoped_ptr<chrome::StorageMonitor> storage_monitor) { + scoped_ptr<StorageMonitor> storage_monitor) { #if !defined(OS_IOS) && !defined(OS_ANDROID) storage_monitor_ = storage_monitor.Pass(); #endif diff --git a/chrome/test/base/testing_browser_process.h b/chrome/test/base/testing_browser_process.h index ea0eb6b..3162de3 100644 --- a/chrome/test/base/testing_browser_process.h +++ b/chrome/test/base/testing_browser_process.h @@ -105,9 +105,8 @@ class TestingBrowserProcess : public BrowserProcess { virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; - virtual chrome::StorageMonitor* storage_monitor() OVERRIDE; - virtual chrome::MediaFileSystemRegistry* - media_file_system_registry() OVERRIDE; + virtual StorageMonitor* storage_monitor() OVERRIDE; + virtual MediaFileSystemRegistry* media_file_system_registry() OVERRIDE; virtual bool created_local_state() const OVERRIDE; #if defined(ENABLE_WEBRTC) @@ -123,7 +122,7 @@ class TestingBrowserProcess : public BrowserProcess { void SetSafeBrowsingService(SafeBrowsingService* sb_service); void SetBookmarkPromptController(BookmarkPromptController* controller); void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); - void SetStorageMonitor(scoped_ptr<chrome::StorageMonitor> storage_monitor); + void SetStorageMonitor(scoped_ptr<StorageMonitor> storage_monitor); private: scoped_ptr<content::NotificationService> notification_service_; @@ -153,8 +152,8 @@ class TestingBrowserProcess : public BrowserProcess { #endif // !defined(OS_IOS) #if !defined(OS_IOS) && !defined(OS_ANDROID) - scoped_ptr<chrome::StorageMonitor> storage_monitor_; - scoped_ptr<chrome::MediaFileSystemRegistry> media_file_system_registry_; + scoped_ptr<StorageMonitor> storage_monitor_; + scoped_ptr<MediaFileSystemRegistry> media_file_system_registry_; #endif // The following objects are not owned by TestingBrowserProcess: |