OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |