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

Unified Diff: chrome/browser/chromeos/system/pointer_device_observer.cc

Issue 10311005: Fix for pointer settings when settings page is refreshed. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/chromeos/system/pointer_device_observer.cc
===================================================================
--- chrome/browser/chromeos/system/pointer_device_observer.cc (revision 134877)
+++ chrome/browser/chromeos/system/pointer_device_observer.cc (working copy)
@@ -28,7 +28,7 @@
} // namespace
PointerDeviceObserver::PointerDeviceObserver()
- : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)){
+ : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
}
PointerDeviceObserver::~PointerDeviceObserver() {
@@ -39,9 +39,13 @@
void PointerDeviceObserver::Init() {
XInputHierarchyChangedEventListener::GetInstance()
->AddObserver(this);
- DeviceHierarchyChanged();
}
+void PointerDeviceObserver::CheckDevices() {
+ CheckMouseExists();
+ CheckTouchpadExists();
+}
+
void PointerDeviceObserver::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}
@@ -51,15 +55,14 @@
}
void PointerDeviceObserver::DeviceHierarchyChanged() {
- CheckMouseExists();
- CheckTouchpadExists();
+ CheckDevices();
}
void PointerDeviceObserver::CheckTouchpadExists() {
bool* exists = new bool;
BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE,
base::Bind(&TouchpadExistsFileThread, exists),
- base::Bind(&PointerDeviceObserver::TouchpadExists,
+ base::Bind(&PointerDeviceObserver::OnTouchpadExists,
weak_factory_.GetWeakPtr(),
base::Owned(exists)));
}
@@ -68,16 +71,16 @@
bool* exists = new bool;
BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE,
base::Bind(&MouseExistsFileThread, exists),
- base::Bind(&PointerDeviceObserver::MouseExists,
+ base::Bind(&PointerDeviceObserver::OnMouseExists,
weak_factory_.GetWeakPtr(),
base::Owned(exists)));
}
-void PointerDeviceObserver::TouchpadExists(bool* exists) {
+void PointerDeviceObserver::OnTouchpadExists(bool* exists) {
FOR_EACH_OBSERVER(Observer, observers_, TouchpadExists(*exists));
}
-void PointerDeviceObserver::MouseExists(bool* exists) {
+void PointerDeviceObserver::OnMouseExists(bool* exists) {
FOR_EACH_OBSERVER(Observer, observers_, MouseExists(*exists));
}
« no previous file with comments | « chrome/browser/chromeos/system/pointer_device_observer.h ('k') | chrome/browser/ui/webui/options2/options_ui2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698