Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3417)

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_utils.cc

Issue 2220453002: Add a button to open TalkBack settings in chrome://settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/arc/arc_app_utils.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.cc b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
index 651bbb810361a9124fd6892fb53364398162094d..c1b7d43a5b1667c59c5bbe06a4cfa909344008e6 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
@@ -30,6 +30,7 @@ constexpr int kNexus5Height = 690;
// Minimum required versions.
constexpr int kMinVersion = 0;
constexpr int kCanHandleResolutionMinVersion = 1;
+constexpr int kSendBroadcastMinVersion = 1;
constexpr int kUninstallPackageMinVersion = 2;
constexpr int kShowPackageInfoMinVersion = 5;
constexpr int kRemoveIconMinVersion = 9;
@@ -227,6 +228,31 @@ bool LaunchApp(content::BrowserContext* context,
->LaunchAndRelease();
}
+void ShowTalkBackSettings() {
+ arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get();
+ if (!bridge_service) {
+ VLOG(2) << "ARC bridge is not ready";
+ return;
+ }
+
+ arc::mojom::IntentHelperInstance *intent_helper_instance =
+ bridge_service->intent_helper()->instance();
+ if (!intent_helper_instance) {
+ VLOG(2) << "ARC intent helper instance is not ready";
+ return;
+ }
+ if (bridge_service->intent_helper()->version() < kSendBroadcastMinVersion) {
+ VLOG(2) << "ARC intent helper instance is too old";
+ return;
+ }
+
+ intent_helper_instance->SendBroadcast(
+ "org.chromium.arc.intent_helper.SHOW_TALKBACK_SETTINGS",
+ "org.chromium.arc.intent_helper",
+ "org.chromium.arc.intent_helper.SettingsReceiver",
+ "{}");
+}
+
bool CanHandleResolution(content::BrowserContext* context,
const std::string& app_id,
const gfx::Rect& rect,
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_utils.h ('k') | chrome/browser/ui/webui/options/browser_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698