Chromium Code Reviews| 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_DOWNLOADS_WATCHER_ARC_DOWNLOADS_WATCHER_SERV ICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_DOWNLOADS_WATCHER_ARC_DOWNLOADS_WATCHER_SERV ICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_DOWNLOADS_WATCHER_ARC_DOWNLOADS_WATCHER_SERV ICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_DOWNLOADS_WATCHER_ARC_DOWNLOADS_WATCHER_SERV ICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | |
| 10 #include <vector> | |
| 9 | 11 |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 12 #include "components/arc/arc_service.h" | 14 #include "components/arc/arc_service.h" |
| 13 #include "components/arc/common/file_system.mojom.h" | 15 #include "components/arc/common/file_system.mojom.h" |
| 14 #include "components/arc/instance_holder.h" | 16 #include "components/arc/instance_holder.h" |
| 15 #include "mojo/public/cpp/bindings/array.h" | |
| 16 #include "mojo/public/cpp/bindings/string.h" | |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class FilePath; | 19 class FilePath; |
| 20 } // namespace base | 20 } // namespace base |
| 21 | 21 |
| 22 namespace arc { | 22 namespace arc { |
| 23 | 23 |
| 24 class ArcBridgeService; | 24 class ArcBridgeService; |
| 25 | 25 |
| 26 // Returns true if the file path has a media extension supported by Android. | 26 // Returns true if the file path has a media extension supported by Android. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 38 // InstanceHolder<mojom::FileSystemInstance>::Observer | 38 // InstanceHolder<mojom::FileSystemInstance>::Observer |
| 39 void OnInstanceReady() override; | 39 void OnInstanceReady() override; |
| 40 void OnInstanceClosed() override; | 40 void OnInstanceClosed() override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 class DownloadsWatcher; | 43 class DownloadsWatcher; |
| 44 | 44 |
| 45 void StartWatchingDownloads(); | 45 void StartWatchingDownloads(); |
| 46 void StopWatchingDownloads(); | 46 void StopWatchingDownloads(); |
| 47 | 47 |
| 48 void OnDownloadsChanged(mojo::Array<mojo::String> paths); | 48 void OnDownloadsChanged(std::vector<std::string> paths); |
|
Yusuke Sato
2016/11/11 17:33:37
const std::vector<std::string>& probably?
The doe
Luis Héctor Chávez
2016/11/11 17:53:38
Done.
| |
| 49 | 49 |
| 50 std::unique_ptr<DownloadsWatcher> watcher_; | 50 std::unique_ptr<DownloadsWatcher> watcher_; |
| 51 | 51 |
| 52 // Note: This should remain the last member so it'll be destroyed and | 52 // Note: This should remain the last member so it'll be destroyed and |
| 53 // invalidate the weak pointers before any other members are destroyed. | 53 // invalidate the weak pointers before any other members are destroyed. |
| 54 base::WeakPtrFactory<ArcDownloadsWatcherService> weak_ptr_factory_; | 54 base::WeakPtrFactory<ArcDownloadsWatcherService> weak_ptr_factory_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(ArcDownloadsWatcherService); | 56 DISALLOW_COPY_AND_ASSIGN(ArcDownloadsWatcherService); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace arc | 59 } // namespace arc |
| 60 | 60 |
| 61 #endif // CHROME_BROWSER_CHROMEOS_ARC_DOWNLOADS_WATCHER_ARC_DOWNLOADS_WATCHER_S ERVICE_H_ | 61 #endif // CHROME_BROWSER_CHROMEOS_ARC_DOWNLOADS_WATCHER_ARC_DOWNLOADS_WATCHER_S ERVICE_H_ |
| OLD | NEW |