| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class BrowserContext; | 14 class BrowserContext; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace arc { | 17 namespace mojo { |
| 18 using CanHandleResolutionCallback = base::Callback<void(bool)>; | 18 class String; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace arc { | 21 namespace arc { |
| 22 | 22 |
| 23 using CanHandleResolutionCallback = base::Callback<void(bool)>; |
| 24 using UninstallAppCallback = base::Callback<void(const mojo::String&)>; |
| 25 |
| 23 bool LaunchApp(content::BrowserContext* context, const std::string& app_id); | 26 bool LaunchApp(content::BrowserContext* context, const std::string& app_id); |
| 24 | 27 |
| 25 // Tests if the application can use the given target resolution. | 28 // Tests if the application can use the given target resolution. |
| 26 // The callback will receive the information once known. | 29 // The callback will receive the information once known. |
| 27 // A false will get returned if the result cannot be determined in which case | 30 // A false will get returned if the result cannot be determined in which case |
| 28 // the callback will not be called. | 31 // the callback will not be called. |
| 29 bool CanHandleResolution(content::BrowserContext* context, | 32 bool CanHandleResolution(content::BrowserContext* context, |
| 30 const std::string& app_id, | 33 const std::string& app_id, |
| 31 const gfx::Rect& rect, | 34 const gfx::Rect& rect, |
| 32 const CanHandleResolutionCallback callback); | 35 const CanHandleResolutionCallback& callback); |
| 36 |
| 37 // Uninstalls the package in ARC. |
| 38 bool UninstallApp(const std::string& package_name, |
| 39 const UninstallAppCallback& callback); |
| 40 void OnUninstallAppResponse(const mojo::String& error_message); |
| 33 | 41 |
| 34 } // namespace arc | 42 } // namespace arc |
| 35 | 43 |
| 36 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ | 44 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ |
| OLD | NEW |