Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/system_logs/touch_log_source.h" | 5 #include "chrome/browser/chromeos/system_logs/touch_log_source.h" |
| 6 | 6 |
| 7 #include "ash/touch/touch_hud_debug.h" | 7 #include "ash/touch/touch_hud_debug.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/process/launch.h" | 12 #include "base/process/launch.h" |
| 13 #include "components/feedback/feedback_util.h" | 13 #include "components/feedback/feedback_util.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "ui/ozone/public/input_controller.h" | |
| 16 #include "ui/ozone/public/ozone_platform.h" | |
| 15 | 17 |
| 16 using content::BrowserThread; | 18 using content::BrowserThread; |
| 17 | 19 |
| 18 namespace { | 20 namespace { |
| 19 | 21 |
| 20 const char kHUDLogDataKey[] = "hud_log"; | 22 const char kHUDLogDataKey[] = "hud_log"; |
| 21 | 23 |
| 22 void GetTouchLogsOzone(system_logs::SystemLogsResponse* response) { | 24 void GetTouchLogsOzone(system_logs::SystemLogsResponse* response) { |
| 23 scoped_ptr<base::DictionaryValue> dictionary = | 25 scoped_ptr<base::DictionaryValue> dictionary = |
| 24 ash::TouchHudDebug::GetAllAsDictionary(); | 26 ash::TouchHudDebug::GetAllAsDictionary(); |
| 25 if (!dictionary->empty()) { | 27 if (!dictionary->empty()) { |
| 26 std::string touch_log; | 28 std::string touch_log; |
| 27 JSONStringValueSerializer json(&touch_log); | 29 JSONStringValueSerializer json(&touch_log); |
| 28 json.set_pretty_print(true); | 30 json.set_pretty_print(true); |
| 29 if (json.Serialize(*dictionary) && !touch_log.empty()) | 31 if (json.Serialize(*dictionary) && !touch_log.empty()) |
| 30 (*response)[kHUDLogDataKey] = touch_log; | 32 (*response)[kHUDLogDataKey] = touch_log; |
| 31 } | 33 } |
| 32 | 34 |
| 33 // TODO(sheckylin): Add ozone touch log collection implementation. See | 35 (*response)["hack-33025-touchpad"] = ui::OzonePlatform::GetInstance() |
|
achuithb
2015/01/22 20:42:12
Make this a const char[] as well, and add a commen
Shecky Lin
2015/01/23 07:46:46
Done.
| |
| 34 // http://crbug.com/400022. | 36 ->GetInputController() |
| 35 NOTIMPLEMENTED(); | 37 ->GetGestureDeviceStatus(); |
| 36 } | 38 } |
| 37 | 39 |
| 38 } // namespace | 40 } // namespace |
| 39 | 41 |
| 40 namespace system_logs { | 42 namespace system_logs { |
| 41 | 43 |
| 42 void TouchLogSource::Fetch(const SysLogsSourceCallback& callback) { | 44 void TouchLogSource::Fetch(const SysLogsSourceCallback& callback) { |
| 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 44 DCHECK(!callback.is_null()); | 46 DCHECK(!callback.is_null()); |
| 45 | 47 |
| 46 SystemLogsResponse* response = new SystemLogsResponse; | 48 SystemLogsResponse* response = new SystemLogsResponse; |
| 47 BrowserThread::PostBlockingPoolTaskAndReply( | 49 BrowserThread::PostBlockingPoolTaskAndReply( |
| 48 FROM_HERE, base::Bind(&GetTouchLogsOzone, response), | 50 FROM_HERE, base::Bind(&GetTouchLogsOzone, response), |
| 49 base::Bind(callback, base::Owned(response))); | 51 base::Bind(callback, base::Owned(response))); |
| 50 } | 52 } |
| 51 | 53 |
| 52 } // namespace system_logs | 54 } // namespace system_logs |
| OLD | NEW |