Chromium Code Reviews| 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 // | |
| 5 // Next MinVersion: 3 | |
| 4 | 6 |
| 5 module arc; | 7 module arc; |
| 6 | 8 |
| 7 // Duplicates ui::ScaleFactor enum in order to be accessible on Android side. | 9 // Duplicates ui::ScaleFactor enum in order to be accessible on Android side. |
| 8 enum ScaleFactor { | 10 enum ScaleFactor { |
| 9 SCALE_FACTOR_NONE = 0, | 11 SCALE_FACTOR_NONE = 0, |
| 10 SCALE_FACTOR_100P, | 12 SCALE_FACTOR_100P, |
| 11 SCALE_FACTOR_125P, | 13 SCALE_FACTOR_125P, |
| 12 SCALE_FACTOR_133P, | 14 SCALE_FACTOR_133P, |
| 13 SCALE_FACTOR_140P, | 15 SCALE_FACTOR_140P, |
| 14 SCALE_FACTOR_150P, | 16 SCALE_FACTOR_150P, |
| 15 SCALE_FACTOR_180P, | 17 SCALE_FACTOR_180P, |
| 16 SCALE_FACTOR_200P, | 18 SCALE_FACTOR_200P, |
| 17 SCALE_FACTOR_250P, | 19 SCALE_FACTOR_250P, |
| 18 SCALE_FACTOR_300P, | 20 SCALE_FACTOR_300P, |
| 19 | 21 |
| 20 NUM_SCALE_FACTORS | 22 NUM_SCALE_FACTORS |
| 21 }; | 23 }; |
| 22 | 24 |
| 23 // Describes ARC app. | 25 // Describes ARC app. |
| 24 struct AppInfo { | 26 struct AppInfo { |
| 25 string name; | 27 string name; |
| 26 string package_name; | 28 string package_name; |
| 27 string activity; | 29 string activity; |
| 30 [MinVersion=2] bool sticky; // true if the app cannot be uninstalled | |
| 28 }; | 31 }; |
| 29 | 32 |
| 30 // Represents a rectangle to specify screen coordinates. | 33 // Represents a rectangle to specify screen coordinates. |
| 31 struct ScreenRect { | 34 struct ScreenRect { |
| 32 int32 left; | 35 int32 left; |
| 33 int32 top; | 36 int32 top; |
| 34 int32 right; | 37 int32 right; |
| 35 int32 bottom; | 38 int32 bottom; |
| 36 }; | 39 }; |
| 37 | 40 |
| 41 // Next method ID: 4 | |
| 38 interface AppHost { | 42 interface AppHost { |
| 39 // Receives a list of available ARC apps to Chrome. Members of AppInfo must | 43 // Receives a list of available ARC apps to Chrome. Members of AppInfo must |
| 40 // contain non-empty string. | 44 // contain non-empty string. |
| 41 OnAppListRefreshed@0(array<AppInfo> apps); | 45 OnAppListRefreshed@0(array<AppInfo> apps); |
| 42 | 46 |
| 43 // Sends newly added ARC app to Chrome. This message is sent when ARC receives | 47 // Sends newly added ARC app to Chrome. This message is sent when ARC receives |
| 44 // package added notification. Multiple apps may be added in the one package. | 48 // package added notification. Multiple apps may be added in the one package. |
| 45 [MinVersion=1] OnAppAdded@2(AppInfo app); | 49 [MinVersion=1] OnAppAdded@2(AppInfo app); |
| 46 | 50 |
| 47 // Sends removed ARC package to Chrome. |package_name| must contain non-empty | 51 // Sends removed ARC package to Chrome. |package_name| must contain non-empty |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 // TODO(lhchavez): Migrate all request/response messages to Mojo. | 66 // TODO(lhchavez): Migrate all request/response messages to Mojo. |
| 63 interface AppInstance { | 67 interface AppInstance { |
| 64 Init(AppHost host_ptr); | 68 Init(AppHost host_ptr); |
| 65 | 69 |
| 66 // Sends a request to ARC to launch an ARC app defined by |package_name| and | 70 // Sends a request to ARC to launch an ARC app defined by |package_name| and |
| 67 // |activity|, which cannot be empty. |dimension_on_screen| can be null to | 71 // |activity|, which cannot be empty. |dimension_on_screen| can be null to |
| 68 // indicate to use the entire screen. | 72 // indicate to use the entire screen. |
| 69 LaunchApp(string package_name, string activity, | 73 LaunchApp(string package_name, string activity, |
| 70 [MinVersion=1] ScreenRect? dimension); | 74 [MinVersion=1] ScreenRect? dimension_on_screen); |
|
victorhsieh0
2016/03/15 17:28:19
Sync this to Android's version to follow the comme
| |
| 71 | 75 |
| 72 // Sends a request to ARC to refresh a list of ARC apps. | 76 // Sends a request to ARC to refresh a list of ARC apps. |
| 73 // OnRefreshAppsList is expected in response to this message. However, | 77 // OnRefreshAppsList is expected in response to this message. However, |
| 74 // response may not be sent if ARC is not ready yet (boot completed event is | 78 // response may not be sent if ARC is not ready yet (boot completed event is |
| 75 // not received). | 79 // not received). |
| 76 RefreshAppList(); | 80 RefreshAppList(); |
| 77 | 81 |
| 78 // Sends a request to ARC for the ARC app icon of a required scale factor. | 82 // Sends a request to ARC for the ARC app icon of a required scale factor. |
| 79 // Scale factor is an enum defined at ui/base/layout.h. App is defined by | 83 // Scale factor is an enum defined at ui/base/layout.h. App is defined by |
| 80 // |package_name| and |activity|, which cannot be empty. | 84 // |package_name| and |activity|, which cannot be empty. |
| 81 RequestAppIcon(string package_name, string activity, | 85 RequestAppIcon(string package_name, string activity, |
| 82 ScaleFactor scale_factor); | 86 ScaleFactor scale_factor); |
| 83 | 87 |
| 84 // Query if a given resolution can be handled by the application. Returns true | 88 // Query if a given resolution can be handled by the application. Returns true |
| 85 // if it can. | 89 // if it can. |
| 86 [MinVersion=1] CanHandleResolution(string package_name, string activity, | 90 [MinVersion=1] CanHandleResolution(string package_name, string activity, |
| 87 ScreenRect dimension) => (bool success); | 91 ScreenRect dimension) => (bool can_handle); |
| 92 | |
| 93 // Sends a request to ARC to uninstall the given package. Error (if ever | |
| 94 // happens) is ignored, and uninstall option should appear in the UI. | |
| 95 [MinVersion=2] UninstallPackage(string package_name); | |
|
victorhsieh0
2016/03/15 17:28:19
Sync this to Android's version to avoid using |pac
| |
| 88 }; | 96 }; |
| OLD | NEW |