OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // GalleryWatchStateTracker implementation. | 5 // GalleryWatchStateTracker implementation. |
6 | 6 |
7 #include "chrome/browser/extensions/api/media_galleries_private/gallery_watch_st
ate_tracker.h" | 7 #include "chrome/browser/extensions/api/media_galleries_private/gallery_watch_st
ate_tracker.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 85 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
86 MediaGalleriesPreferences* preferences = | 86 MediaGalleriesPreferences* preferences = |
87 g_browser_process->media_file_system_registry()->GetPreferences(profile_); | 87 g_browser_process->media_file_system_registry()->GetPreferences(profile_); |
88 preferences->RemoveGalleryChangeObserver(this); | 88 preferences->RemoveGalleryChangeObserver(this); |
89 } | 89 } |
90 | 90 |
91 // static | 91 // static |
92 GalleryWatchStateTracker* GalleryWatchStateTracker::GetForProfile( | 92 GalleryWatchStateTracker* GalleryWatchStateTracker::GetForProfile( |
93 Profile* profile) { | 93 Profile* profile) { |
94 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 94 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
95 #if defined(OS_WIN) | 95 #if defined(OS_WIN) || defined(OS_LINUX) |
96 // Gallery watch operation is supported only on windows. | 96 // Gallery watch operation is not supported on Mac: crbug.com/144491. |
97 // Please refer to crbug.com/144491 for more details. | |
98 DCHECK(profile); | 97 DCHECK(profile); |
99 MediaGalleriesPrivateAPI* private_api = | 98 MediaGalleriesPrivateAPI* private_api = |
100 MediaGalleriesPrivateAPI::Get(profile); | 99 MediaGalleriesPrivateAPI::Get(profile); |
101 // In unit tests, we don't have a MediaGalleriesPrivateAPI. | 100 // In unit tests, we don't have a MediaGalleriesPrivateAPI. |
102 if (private_api) | 101 if (private_api) |
103 return private_api->GetGalleryWatchStateTracker(); | 102 return private_api->GetGalleryWatchStateTracker(); |
104 #endif | 103 #endif |
105 return NULL; | 104 return NULL; |
106 } | 105 } |
107 | 106 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 const std::string& extension_id, | 330 const std::string& extension_id, |
332 MediaGalleryPrefId gallery_id) { | 331 MediaGalleryPrefId gallery_id) { |
333 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 332 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
334 if (HasGalleryWatchInfo(extension_id, gallery_id, true)) | 333 if (HasGalleryWatchInfo(extension_id, gallery_id, true)) |
335 return false; | 334 return false; |
336 watched_extensions_map_[extension_id][gallery_id] = true; | 335 watched_extensions_map_[extension_id][gallery_id] = true; |
337 return true; | 336 return true; |
338 } | 337 } |
339 | 338 |
340 } // namespace extensions | 339 } // namespace extensions |
OLD | NEW |