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

Unified Diff: chrome/browser/ui/webui/options/chromeos/system_options_handler.cc

Issue 8249011: Remove 'Enable tap-to-click' checkbox for non-touchpad devices. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: cleanup TouchpadSettings interface Created 9 years, 2 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
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/system_options_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/system_options_handler.cc
===================================================================
--- chrome/browser/ui/webui/options/chromeos/system_options_handler.cc (revision 106949)
+++ chrome/browser/ui/webui/options/chromeos/system_options_handler.cc (working copy)
@@ -20,6 +20,7 @@
#include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
#include "chrome/browser/chromeos/dbus/power_manager_client.h"
#include "chrome/browser/chromeos/language_preferences.h"
+#include "chrome/browser/chromeos/system/touchpad_settings.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -35,6 +36,14 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+namespace {
+
+void TouchpadExistsFileThread(bool* exists) {
+ *exists = chromeos::system::touchpad_settings::TouchpadExists();
+}
+
+}
+
SystemOptionsHandler::SystemOptionsHandler()
: chromeos::CrosOptionsPageUIHandler(
new chromeos::SystemSettingsProvider()) {
@@ -106,8 +115,19 @@
base::FundamentalValue checked(acc_enabled);
web_ui_->CallJavascriptFunction(
"options.SystemOptions.SetAccessibilityCheckboxState", checked);
+
+ bool* exists = new bool;
+ BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE,
+ base::Bind(&TouchpadExistsFileThread, exists),
+ base::Bind(&SystemOptionsHandler::TouchpadExists, AsWeakPtr(), exists));
}
+void SystemOptionsHandler::TouchpadExists(bool* exists) {
+ if (*exists)
+ web_ui_->CallJavascriptFunction("options.SystemOptions.showTapToClick");
+ delete exists;
+}
+
void SystemOptionsHandler::RegisterMessages() {
DCHECK(web_ui_);
web_ui_->RegisterMessageCallback("accessibilityChange",
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/system_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698