OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 | 5 |
6 class PossibleApp(object): | 6 class PossibleApp(object): |
7 """A factory class that can be used to create a running instance of app. | 7 """A factory class that can be used to create a running instance of app. |
8 | 8 |
9 Call Create() to launch the app and begin manipulating it. | 9 Call Create() to launch the app and begin manipulating it. |
10 """ | 10 """ |
11 | 11 |
12 def __init__(self, app_type, target_os): | 12 def __init__(self, app_type, target_os, device_id): |
13 self._app_type = app_type | 13 self._app_type = app_type |
14 self._target_os = target_os | 14 self._target_os = target_os |
| 15 self._device_id = device_id |
15 self._platform = None | 16 self._platform = None |
16 self._platform_backend = None | 17 self._platform_backend = None |
17 | 18 |
18 def __repr__(self): | 19 def __repr__(self): |
19 return 'PossibleApp(app_type=%s)' % self.app_type | 20 return 'PossibleApp(app_type=%s)' % self.app_type |
20 | 21 |
21 @property | 22 @property |
22 def app_type(self): | 23 def app_type(self): |
23 return self._app_type | 24 return self._app_type |
24 | 25 |
25 @property | 26 @property |
26 def target_os(self): | 27 def target_os(self): |
27 """Target OS, the app will run on.""" | 28 """Target OS, the app will run on.""" |
28 return self._target_os | 29 return self._target_os |
29 | 30 |
30 @property | 31 @property |
| 32 def device_id(self): |
| 33 """The ID of the device the app will run on.""" |
| 34 return self._device_id |
| 35 |
| 36 @property |
31 def platform(self): | 37 def platform(self): |
32 self._InitPlatformIfNeeded() | 38 self._InitPlatformIfNeeded() |
33 return self._platform | 39 return self._platform |
34 | 40 |
35 def _InitPlatformIfNeeded(self): | 41 def _InitPlatformIfNeeded(self): |
36 raise NotImplementedError() | 42 raise NotImplementedError() |
37 | 43 |
38 def Create(self, finder_options): | 44 def Create(self, finder_options): |
39 raise NotImplementedError() | 45 raise NotImplementedError() |
40 | 46 |
41 def SupportsOptions(self, finder_options): | 47 def SupportsOptions(self, finder_options): |
42 """Tests for extension support.""" | 48 """Tests for extension support.""" |
43 raise NotImplementedError() | 49 raise NotImplementedError() |
OLD | NEW |