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

Side by Side Diff: chrome/browser/chromeos/arc/arc_downloads_watcher_service.h

Issue 2379323002: arc: Exclude non-media files from Android media scanning. (Closed)
Patch Set: Addressed comments from yusukes. Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "components/arc/arc_bridge_service.h" 13 #include "components/arc/arc_bridge_service.h"
14 #include "components/arc/arc_service.h" 14 #include "components/arc/arc_service.h"
15 #include "components/arc/instance_holder.h" 15 #include "components/arc/instance_holder.h"
16 16
17 namespace base { 17 namespace base {
18 class FilePath; 18 class FilePath;
19 } 19 }
20 20
21 namespace arc { 21 namespace arc {
22 22
23 // Returns true if the file path has a media extension supported by Android.
24 bool HasAndroidSupportedMediaExtension(const base::FilePath& path);
25
23 // Watches Downloads directory and registers newly created media files to 26 // Watches Downloads directory and registers newly created media files to
24 // Android MediaProvider. 27 // Android MediaProvider.
25 class ArcDownloadsWatcherService 28 class ArcDownloadsWatcherService
26 : public ArcService, 29 : public ArcService,
27 public InstanceHolder<mojom::FileSystemInstance>::Observer { 30 public InstanceHolder<mojom::FileSystemInstance>::Observer {
28 public: 31 public:
29 explicit ArcDownloadsWatcherService(ArcBridgeService* bridge_service); 32 explicit ArcDownloadsWatcherService(ArcBridgeService* bridge_service);
30 ~ArcDownloadsWatcherService() override; 33 ~ArcDownloadsWatcherService() override;
31 34
32 // InstanceHolder<mojom::FileSystemInstance>::Observer 35 // InstanceHolder<mojom::FileSystemInstance>::Observer
(...skipping 13 matching lines...) Expand all
46 // Note: This should remain the last member so it'll be destroyed and 49 // Note: This should remain the last member so it'll be destroyed and
47 // invalidate the weak pointers before any other members are destroyed. 50 // invalidate the weak pointers before any other members are destroyed.
48 base::WeakPtrFactory<ArcDownloadsWatcherService> weak_ptr_factory_; 51 base::WeakPtrFactory<ArcDownloadsWatcherService> weak_ptr_factory_;
49 52
50 DISALLOW_COPY_AND_ASSIGN(ArcDownloadsWatcherService); 53 DISALLOW_COPY_AND_ASSIGN(ArcDownloadsWatcherService);
51 }; 54 };
52 55
53 } // namespace arc 56 } // namespace arc
54 57
55 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_ 58 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698