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

Side by Side Diff: chrome/browser/media_galleries/media_scan_manager.h

Issue 285433004: Have FindContainerScanResults() find broader media container directories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed other unit tests Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/media_galleries/media_scan_manager.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_SCAN_MANAGER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_SCAN_MANAGER_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_SCAN_MANAGER_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_SCAN_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // The results of the scan are reported to the registered 47 // The results of the scan are reported to the registered
48 // MediaScanManagerObserver via OnScanFinished. There must be an observer 48 // MediaScanManagerObserver via OnScanFinished. There must be an observer
49 // registered for |profile| before the scan starts. 49 // registered for |profile| before the scan starts.
50 void StartScan(Profile* profile, const extensions::Extension* extension, 50 void StartScan(Profile* profile, const extensions::Extension* extension,
51 bool user_gesture); 51 bool user_gesture);
52 void CancelScan(Profile* profile, const extensions::Extension* extension); 52 void CancelScan(Profile* profile, const extensions::Extension* extension);
53 53
54 protected: 54 protected:
55 friend class MediaGalleriesPlatformAppBrowserTest; 55 friend class MediaGalleriesPlatformAppBrowserTest;
56 friend class MediaScanManagerTest;
56 57
57 typedef base::Callback<MediaFolderFinder*( 58 typedef base::Callback<MediaFolderFinder*(
58 const MediaFolderFinder::MediaFolderFinderResultsCallback&)> 59 const MediaFolderFinder::MediaFolderFinderResultsCallback&)>
59 MediaFolderFinderFactory; 60 MediaFolderFinderFactory;
60 61
61 void SetMediaFolderFinderFactory(const MediaFolderFinderFactory& factory); 62 void SetMediaFolderFinderFactory(const MediaFolderFinderFactory& factory);
62 63
64 // Here so that friend MediaScanManagerTest can access it.
65 static MediaFolderFinder::MediaFolderFinderResults FindContainerScanResults(
66 const MediaFolderFinder::MediaFolderFinderResults& found_folders,
67 const std::vector<base::FilePath>& sensitive_locations);
68
63 private: 69 private:
64 struct ScanObservers { 70 struct ScanObservers {
65 ScanObservers(); 71 ScanObservers();
66 ~ScanObservers(); 72 ~ScanObservers();
67 MediaScanManagerObserver* observer; 73 MediaScanManagerObserver* observer;
68 std::set<std::string /*extension id*/> scanning_extensions; 74 std::set<std::string /*extension id*/> scanning_extensions;
69 }; 75 };
70 typedef std::map<Profile*, ScanObservers> ScanObserverMap; 76 typedef std::map<Profile*, ScanObservers> ScanObserverMap;
71 77
72 // extensions::ExtensionRegistryObserver implementation. 78 // extensions::ExtensionRegistryObserver implementation.
(...skipping 25 matching lines...) Expand all
98 ScopedObserver<extensions::ExtensionRegistry, 104 ScopedObserver<extensions::ExtensionRegistry,
99 extensions::ExtensionRegistryObserver> 105 extensions::ExtensionRegistryObserver>
100 scoped_extension_registry_observer_; 106 scoped_extension_registry_observer_;
101 107
102 base::WeakPtrFactory<MediaScanManager> weak_factory_; 108 base::WeakPtrFactory<MediaScanManager> weak_factory_;
103 109
104 DISALLOW_COPY_AND_ASSIGN(MediaScanManager); 110 DISALLOW_COPY_AND_ASSIGN(MediaScanManager);
105 }; 111 };
106 112
107 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_SCAN_MANAGER_H_ 113 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_SCAN_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/media_scan_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698