 Chromium Code Reviews
 Chromium Code Reviews Issue 1756193008:
  Support uninstalling ARC app from Chrome launcher  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1756193008:
  Support uninstalling ARC app from Chrome launcher  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 module arc; | 5 module arc; | 
| 6 | 6 | 
| 7 // Duplicates ui::ScaleFactor enum in order to be accessible on Android side. | 7 // Duplicates ui::ScaleFactor enum in order to be accessible on Android side. | 
| 8 enum ScaleFactor { | 8 enum ScaleFactor { | 
| 9 SCALE_FACTOR_NONE = 0, | 9 SCALE_FACTOR_NONE = 0, | 
| 10 SCALE_FACTOR_100P, | 10 SCALE_FACTOR_100P, | 
| 11 SCALE_FACTOR_125P, | 11 SCALE_FACTOR_125P, | 
| 12 SCALE_FACTOR_133P, | 12 SCALE_FACTOR_133P, | 
| 13 SCALE_FACTOR_140P, | 13 SCALE_FACTOR_140P, | 
| 14 SCALE_FACTOR_150P, | 14 SCALE_FACTOR_150P, | 
| 15 SCALE_FACTOR_180P, | 15 SCALE_FACTOR_180P, | 
| 16 SCALE_FACTOR_200P, | 16 SCALE_FACTOR_200P, | 
| 17 SCALE_FACTOR_250P, | 17 SCALE_FACTOR_250P, | 
| 18 SCALE_FACTOR_300P, | 18 SCALE_FACTOR_300P, | 
| 19 | 19 | 
| 20 NUM_SCALE_FACTORS | 20 NUM_SCALE_FACTORS | 
| 21 }; | 21 }; | 
| 22 | 22 | 
| 23 // Describes ARC app. | 23 // Describes ARC app. | 
| 24 struct AppInfo { | 24 struct AppInfo { | 
| 25 string name; | 25 string name; | 
| 26 string package_name; | 26 string package_name; | 
| 27 string activity; | 27 string activity; | 
| 28 [MinVersion=2] bool uninstallable; | |
| 28 }; | 29 }; | 
| 29 | 30 | 
| 30 // Represents a rectangle to specify screen coordinates. | 31 // Represents a rectangle to specify screen coordinates. | 
| 31 struct ScreenRect { | 32 struct ScreenRect { | 
| 32 int32 left; | 33 int32 left; | 
| 33 int32 top; | 34 int32 top; | 
| 34 int32 right; | 35 int32 right; | 
| 35 int32 bottom; | 36 int32 bottom; | 
| 36 }; | 37 }; | 
| 37 | 38 | 
| (...skipping 12 matching lines...) Expand all Loading... | |
| 50 // app. | 51 // app. | 
| 51 [MinVersion=1] OnPackageRemoved@3(string package_name); | 52 [MinVersion=1] OnPackageRemoved@3(string package_name); | 
| 52 | 53 | 
| 53 // Receives an icon of required |scale_factor| for specific ARC app. The app | 54 // Receives an icon of required |scale_factor| for specific ARC app. The app | 
| 54 // is defined by |package_name| and |activity|. The icon content cannot be | 55 // is defined by |package_name| and |activity|. The icon content cannot be | 
| 55 // empty and must match to |scale_factor| assuming 48x48 for | 56 // empty and must match to |scale_factor| assuming 48x48 for | 
| 56 // SCALE_FACTOR_100P. |scale_factor| is an enum defined at ui/base/layout.h. | 57 // SCALE_FACTOR_100P. |scale_factor| is an enum defined at ui/base/layout.h. | 
| 57 // |icon_png_data| is a png-encoded image. | 58 // |icon_png_data| is a png-encoded image. | 
| 58 OnAppIcon@1(string package_name, string activity, | 59 OnAppIcon@1(string package_name, string activity, | 
| 59 ScaleFactor scale_factor, array<uint8> icon_png_data); | 60 ScaleFactor scale_factor, array<uint8> icon_png_data); | 
| 61 | |
| 62 // Sends the error message (null if succeeds) to the host. | |
| 63 [MinVersion=2] OnUninstallAppResponse@4(string error_message); | |
| 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); | 
| 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 success); | 
| 92 | |
| 93 // Sends a request to ARC to uninstall the given app. Response will be | |
| 94 // returned via AppHost.OnUninstallAppResponse. | |
| 95 [MinVersion=2] UninstallApp(string package); | |
| 
Luis Héctor Chávez
2016/03/04 21:29:37
Can you instead do
[MinVersion=2] UninstallApp(st
 
khmel
2016/03/04 22:02:40
Do we really want sync method? This is UI thread.
 
Luis Héctor Chávez
2016/03/04 22:05:15
Mojo has no support for sync IPC. This is async :)
 
victorhsieh0
2016/03/07 21:00:16
Done.
 | |
| 88 }; | 96 }; | 
| OLD | NEW |