| 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_observer_hud.h" | 7 #include "ash/touch/touch_hud_debug.h" |
| 8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "chrome/browser/feedback/feedback_util.h" | 9 #include "chrome/browser/feedback/feedback_util.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 11 | 11 |
| 12 const char kHUDLogDataKey[] = "hud_log"; | 12 const char kHUDLogDataKey[] = "hud_log"; |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 | 15 |
| 16 TouchLogSource::TouchLogSource() { | 16 TouchLogSource::TouchLogSource() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 TouchLogSource::~TouchLogSource() { | 19 TouchLogSource::~TouchLogSource() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 void TouchLogSource::Fetch(const SysLogsSourceCallback& callback) { | 22 void TouchLogSource::Fetch(const SysLogsSourceCallback& callback) { |
| 23 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 23 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 24 DCHECK(!callback.is_null()); | 24 DCHECK(!callback.is_null()); |
| 25 | 25 |
| 26 SystemLogsResponse response; | 26 SystemLogsResponse response; |
| 27 scoped_ptr<DictionaryValue> dictionary = | 27 scoped_ptr<DictionaryValue> dictionary = |
| 28 ash::internal::TouchObserverHUD::GetAllAsDictionary(); | 28 ash::internal::TouchHudDebug::GetAllAsDictionary(); |
| 29 if (!dictionary->empty()) { | 29 if (!dictionary->empty()) { |
| 30 std::string touch_log; | 30 std::string touch_log; |
| 31 JSONStringValueSerializer json(&touch_log); | 31 JSONStringValueSerializer json(&touch_log); |
| 32 json.set_pretty_print(true); | 32 json.set_pretty_print(true); |
| 33 if (json.Serialize(*dictionary) && !touch_log.empty()) | 33 if (json.Serialize(*dictionary) && !touch_log.empty()) |
| 34 response[kHUDLogDataKey] = touch_log; | 34 response[kHUDLogDataKey] = touch_log; |
| 35 } | 35 } |
| 36 callback.Run(&response); | 36 callback.Run(&response); |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace chromeos | 39 } // namespace chromeos |
| OLD | NEW |