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