OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
ppi
2015/11/24 12:17:57
If we want to intentionally keep this as close as
qsr
2015/11/24 13:05:05
Added a comment about the origin of the file.
| |
5 [DartPackage="mojo_services"] | |
6 module activity; | |
7 | |
8 struct StringExtra { | |
9 string name; | |
10 string value; | |
11 }; | |
12 | |
13 struct ComponentName { | |
14 string package_name; | |
15 string class_name; | |
16 }; | |
17 | |
18 struct Intent { | |
19 string action; | |
20 string url; | |
21 uint32 flags; | |
22 ComponentName? component; | |
23 array<StringExtra>? string_extras; | |
24 string? type; | |
25 }; | |
26 | |
27 struct TaskDescription { | |
28 string? label; | |
29 uint32 primaryColor; | |
30 }; | |
31 | |
32 enum SystemUIVisibility { | |
33 STANDARD, | |
34 FULLSCREEN, | |
35 IMMERSIVE, | |
36 }; | |
37 | |
38 // See http://developer.android.com/intl/es/reference/android/R.attr.html#screen Orientation | |
39 enum ScreenOrientation { | |
40 UNSPECIFIED, | |
41 LANDSCAPE, | |
42 PORTRAIT, | |
43 NOSENSOR, | |
44 }; | |
45 | |
46 // TODO(abarth): This interface seems very specific to Android. Do we want to | |
47 // have a higher-level abstraction here? Do we want a collection | |
48 // of services that only work on specific platforms? We need to | |
49 // figure out how to rationalize this interface across platforms. | |
50 [ServiceName="activity::Activity"] | |
51 interface Activity { | |
52 GetUserFeedback(UserFeedback& user_feedback); | |
53 | |
54 StartActivity(Intent intent); | |
55 FinishCurrentActivity(); | |
56 SetTaskDescription(TaskDescription description); | |
57 SetSystemUIVisibility(SystemUIVisibility visibility); | |
58 SetRequestedOrientation(ScreenOrientation orientation); | |
59 }; | |
60 | |
61 interface PathService { | |
ppi
2015/11/24 12:17:57
PathService now has ServiceName in https://github.
qsr
2015/11/24 13:05:05
Done.
| |
62 // Where the application files are. | |
63 GetAppDataDir() => (string path); | |
64 | |
65 // Where to store long-term files. | |
66 GetFilesDir() => (string path); | |
67 | |
68 // Where to store short-term files. | |
69 GetCacheDir() => (string path); | |
70 }; | |
71 | |
72 enum HapticFeedbackType { | |
73 LONG_PRESS, | |
74 VIRTUAL_KEY, | |
75 KEYBOARD_TAP, | |
76 CLOCK_TICK, | |
77 }; | |
78 | |
79 enum AuralFeedbackType { | |
80 CLICK, | |
81 NAVIGATION_LEFT, | |
82 NAVIGATION_UP, | |
83 NAVIGATION_RIGHT, | |
84 NAVIGATION_DOWN, | |
85 }; | |
86 | |
87 interface UserFeedback { | |
88 PerformHapticFeedback(HapticFeedbackType type); | |
89 PerformAuralFeedback(AuralFeedbackType type); | |
90 }; | |
OLD | NEW |