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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc

Issue 2200463002: Reorganize accessibility settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address last feedback from dbeam 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/webui/settings/chromeos/accessibility_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc b/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b90787d954770bad0ce36726f25eb46b14c03bd8
--- /dev/null
+++ b/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "chrome/browser/extensions/extension_tab_util.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/common/extensions/extension_constants.h"
+#include "content/public/browser/web_ui.h"
+#include "extensions/browser/extension_registry.h"
+
+namespace chromeos {
+namespace settings {
+
+AccessibilityHandler::AccessibilityHandler(content::WebUI* webui)
+ : profile_(Profile::FromWebUI(webui)) {
+}
+
+AccessibilityHandler::~AccessibilityHandler() {}
+
+void AccessibilityHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ "showChromeVoxSettings",
+ base::Bind(&AccessibilityHandler::HandleShowChromeVoxSettings,
+ base::Unretained(this)));
+}
+
+void AccessibilityHandler::HandleShowChromeVoxSettings(
+ const base::ListValue* args) {
+ const extensions::Extension* chromevox_extension =
+ extensions::ExtensionRegistry::Get(profile_)->GetExtensionById(
+ extension_misc::kChromeVoxExtensionId,
+ extensions::ExtensionRegistry::ENABLED);
+ if (!chromevox_extension)
+ return;
+ extensions::ExtensionTabUtil::OpenOptionsPage(
+ chromevox_extension,
+ chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()));
+}
+
+} // namespace settings
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698