| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 DEVICE_DEVICES_APP_PUBLIC_CPP_DEVICES_APP_FACTORY_H_ | 5 #ifndef DEVICE_DEVICES_APP_PUBLIC_CPP_DEVICES_APP_FACTORY_H_ |
| 6 #define DEVICE_DEVICES_APP_PUBLIC_CPP_DEVICES_APP_FACTORY_H_ | 6 #define DEVICE_DEVICES_APP_PUBLIC_CPP_DEVICES_APP_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 namespace base { | |
| 12 class SequencedTaskRunner; | |
| 13 } | |
| 14 | |
| 15 namespace mojo { | 11 namespace mojo { |
| 16 class ApplicationDelegate; | 12 class ApplicationDelegate; |
| 17 } | 13 } |
| 18 | 14 |
| 19 namespace device { | 15 namespace device { |
| 20 | 16 |
| 21 // Public factory for creating new instances of the devices app. | 17 // Public factory for creating new instances of the devices app. |
| 22 class DevicesAppFactory { | 18 class DevicesAppFactory { |
| 23 public: | 19 public: |
| 24 // Creates a DevicesApp delegate which can be used to launch a new instance | 20 // Creates a DevicesApp delegate which can be used to launch a new instance |
| 25 // of the devices app on a mojo application runner. The caller owns the | 21 // of the devices app on a mojo application runner. The caller owns the |
| 26 // delegate. | 22 // delegate. |
| 27 // | 23 static scoped_ptr<mojo::ApplicationDelegate> CreateApp(); |
| 28 // |service_task_runner| is the thread TaskRunner on which the UsbService | |
| 29 // lives. This argument should be removed once UsbService is owned by the | |
| 30 // USB device manager and no longer part of the public device API. If null, | |
| 31 // the app will construct its own DeviceClient and UsbService. | |
| 32 static scoped_ptr<mojo::ApplicationDelegate> CreateApp( | |
| 33 scoped_refptr<base::SequencedTaskRunner> service_task_runner); | |
| 34 }; | 24 }; |
| 35 | 25 |
| 36 } // namespace device | 26 } // namespace device |
| 37 | 27 |
| 38 #endif // DEVICE_DEVICES_APP_PUBLIC_CPP_DEVICES_APP_FACTORY_H_ | 28 #endif // DEVICE_DEVICES_APP_PUBLIC_CPP_DEVICES_APP_FACTORY_H_ |
| OLD | NEW |