Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.cc

Issue 282153002: Media Galleries: Enable chrome.mediaGalleriesPrivate.onGalleryChanged and friends on Linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698