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

Unified Diff: chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc

Issue 864253002: Dump property values for the touch log source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix %lu -> %zu Created 5 years, 11 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 | « no previous file | ui/events/ozone/evdev/input_controller_evdev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc
diff --git a/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc b/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc
index 3e9f16524ca3b09afa34f637be703fbd256ced40..078b692ee0a62ff3bcf2c38ddabecc91883906a4 100644
--- a/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc
+++ b/chrome/browser/chromeos/system_logs/touch_log_source_ozone.cc
@@ -6,12 +6,17 @@
#include "ash/touch/touch_hud_debug.h"
#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/callback.h"
#include "base/command_line.h"
#include "base/json/json_string_value_serializer.h"
#include "base/logging.h"
+#include "base/message_loop/message_loop.h"
#include "base/process/launch.h"
#include "components/feedback/feedback_util.h"
#include "content/public/browser/browser_thread.h"
+#include "ui/ozone/public/input_controller.h"
+#include "ui/ozone/public/ozone_platform.h"
using content::BrowserThread;
@@ -19,7 +24,26 @@ namespace {
const char kHUDLogDataKey[] = "hud_log";
-void GetTouchLogsOzone(system_logs::SystemLogsResponse* response) {
+// The prefix "hack-33025" was historically chosen in http://crbug.com/139715.
+// We continue to go with it in order to be compatible with the existing touch
+// log processing toolchain.
+const char kDeviceStatusLogDataKey[] = "hack-33025-touchpad";
+
+// Callback for handing the outcome of GetTouchDeviceStatus(). Appends the
+// collected log to the SystemLogsResponse map.
+void OnStatusLogCollected(scoped_ptr<system_logs::SystemLogsResponse> response,
+ const system_logs::SysLogsSourceCallback& callback,
+ scoped_ptr<std::string> log) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ (*response)[kDeviceStatusLogDataKey] = *log;
+
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(callback, base::Owned(response.release())));
+}
+
+// Collect touch HUD debug logs. This needs to be done on the UI thread.
+void CollectTouchHudDebugLog(system_logs::SystemLogsResponse* response) {
scoped_ptr<base::DictionaryValue> dictionary =
ash::TouchHudDebug::GetAllAsDictionary();
if (!dictionary->empty()) {
@@ -29,10 +53,6 @@ void GetTouchLogsOzone(system_logs::SystemLogsResponse* response) {
if (json.Serialize(*dictionary) && !touch_log.empty())
(*response)[kHUDLogDataKey] = touch_log;
}
-
- // TODO(sheckylin): Add ozone touch log collection implementation. See
- // http://crbug.com/400022.
- NOTIMPLEMENTED();
}
} // namespace
@@ -43,10 +63,12 @@ void TouchLogSource::Fetch(const SysLogsSourceCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- SystemLogsResponse* response = new SystemLogsResponse;
- BrowserThread::PostBlockingPoolTaskAndReply(
- FROM_HERE, base::Bind(&GetTouchLogsOzone, response),
- base::Bind(callback, base::Owned(response)));
+ scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse);
+ CollectTouchHudDebugLog(response.get());
+
+ // Collect touch device status logs.
+ ui::OzonePlatform::GetInstance()->GetInputController()->GetTouchDeviceStatus(
+ base::Bind(&OnStatusLogCollected, base::Passed(&response), callback));
}
} // namespace system_logs
« no previous file with comments | « no previous file | ui/events/ozone/evdev/input_controller_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698