| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 extern const char kPlayStorePackage[]; | 21 extern const char kPlayStorePackage[]; |
| 22 extern const char kPlayStoreActivity[]; | 22 extern const char kPlayStoreActivity[]; |
| 23 extern const char kSettingsAppId[]; | 23 extern const char kSettingsAppId[]; |
| 24 | 24 |
| 25 using CanHandleResolutionCallback = base::Callback<void(bool)>; | 25 using CanHandleResolutionCallback = base::Callback<void(bool)>; |
| 26 | 26 |
| 27 // Checks if a given app should be hidden in launcher. | 27 // Checks if a given app should be hidden in launcher. |
| 28 bool ShouldShowInLauncher(const std::string& app_id); | 28 bool ShouldShowInLauncher(const std::string& app_id); |
| 29 | 29 |
| 30 // Launch an app and let the system decides how big and where to place it. | 30 // Launch an app and let the system decides how big and where to place it. |
| 31 bool LaunchApp(content::BrowserContext* context, const std::string& app_id); | 31 bool LaunchApp(content::BrowserContext* context, |
| 32 const std::string& app_id, |
| 33 int event_flags); |
| 32 | 34 |
| 33 // Launch Android Settings app. | 35 // Launch Android Settings app. |
| 34 bool LaunchAndroidSettingsApp(content::BrowserContext* context); | 36 bool LaunchAndroidSettingsApp(content::BrowserContext* context, |
| 37 int event_flags); |
| 35 | 38 |
| 36 // Launch an app with given layout and let the system decides how big and where | 39 // Launch an app with given layout and let the system decides how big and where |
| 37 // to place it. | 40 // to place it. |
| 38 bool LaunchApp(content::BrowserContext* context, | 41 bool LaunchApp(content::BrowserContext* context, |
| 39 const std::string& app_id, | 42 const std::string& app_id, |
| 40 bool landscape_layout); | 43 bool landscape_layout, |
| 44 int event_flags); |
| 41 | 45 |
| 42 // Launch an app and place it at the specified coordinates. | 46 // Launch an app and place it at the specified coordinates. |
| 43 bool LaunchAppWithRect(content::BrowserContext* context, | 47 bool LaunchAppWithRect(content::BrowserContext* context, |
| 44 const std::string& app_id, | 48 const std::string& app_id, |
| 45 const gfx::Rect& target_rect); | 49 const gfx::Rect& target_rect, |
| 50 int event_flags); |
| 46 | 51 |
| 47 // Sets task active. | 52 // Sets task active. |
| 48 void SetTaskActive(int task_id); | 53 void SetTaskActive(int task_id); |
| 49 | 54 |
| 50 // Closes the task. | 55 // Closes the task. |
| 51 void CloseTask(int task_id); | 56 void CloseTask(int task_id); |
| 52 | 57 |
| 53 // Open TalkBack settings window. | 58 // Open TalkBack settings window. |
| 54 void ShowTalkBackSettings(); | 59 void ShowTalkBackSettings(); |
| 55 | 60 |
| 56 // Tests if the application can use the given target resolution. | 61 // Tests if the application can use the given target resolution. |
| 57 // The callback will receive the information once known. | 62 // The callback will receive the information once known. |
| 58 // A false will get returned if the result cannot be determined in which case | 63 // A false will get returned if the result cannot be determined in which case |
| 59 // the callback will not be called. | 64 // the callback will not be called. |
| 60 bool CanHandleResolution(content::BrowserContext* context, | 65 bool CanHandleResolution(content::BrowserContext* context, |
| 61 const std::string& app_id, | 66 const std::string& app_id, |
| 62 const gfx::Rect& rect, | 67 const gfx::Rect& rect, |
| 63 const CanHandleResolutionCallback& callback); | 68 const CanHandleResolutionCallback& callback); |
| 64 | 69 |
| 65 // Uninstalls the package in ARC. | 70 // Uninstalls the package in ARC. |
| 66 void UninstallPackage(const std::string& package_name); | 71 void UninstallPackage(const std::string& package_name); |
| 67 | 72 |
| 68 // Removes cached app shortcut icon in ARC. | 73 // Removes cached app shortcut icon in ARC. |
| 69 void RemoveCachedIcon(const std::string& icon_resource_id); | 74 void RemoveCachedIcon(const std::string& icon_resource_id); |
| 70 | 75 |
| 71 // Show package info for ARC package. | 76 // Show package info for ARC package. |
| 72 // Deprecated. Use ShowPackageInfoOnPage. | 77 // Deprecated. Use ShowPackageInfoOnPage. |
| 73 bool ShowPackageInfo(const std::string& package_name); | 78 bool ShowPackageInfo(const std::string& package_name); |
| 74 | 79 |
| 75 // Show package info for ARC package at the specified page. | 80 // Show package info for ARC package at the specified page. |
| 76 bool ShowPackageInfoOnPage(const std::string& package_name, | 81 bool ShowPackageInfoOnPage(const std::string& package_name, |
| 77 mojom::ShowPackageInfoPage page); | 82 mojom::ShowPackageInfoPage page); |
| 78 | 83 |
| 79 } // namespace arc | 84 } // namespace arc |
| 80 | 85 |
| 81 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ | 86 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_UTILS_H_ |
| OLD | NEW |