OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/webui/sync_file_system_internals/sync_file_system_in
ternals_handler.h" | 5 #include "chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_in
ternals_handler.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 void SyncFileSystemInternalsHandler::OnLogRecorded( | 98 void SyncFileSystemInternalsHandler::OnLogRecorded( |
99 const sync_file_system::TaskLogger::TaskLog& task_log) { | 99 const sync_file_system::TaskLogger::TaskLog& task_log) { |
100 base::DictionaryValue dict; | 100 base::DictionaryValue dict; |
101 int64_t duration = (task_log.end_time - task_log.start_time).InMilliseconds(); | 101 int64_t duration = (task_log.end_time - task_log.start_time).InMilliseconds(); |
102 dict.SetInteger("duration", duration); | 102 dict.SetInteger("duration", duration); |
103 dict.SetString("task_description", task_log.task_description); | 103 dict.SetString("task_description", task_log.task_description); |
104 dict.SetString("result_description", task_log.result_description); | 104 dict.SetString("result_description", task_log.result_description); |
105 | 105 |
106 scoped_ptr<base::ListValue> details(new base::ListValue); | 106 std::unique_ptr<base::ListValue> details(new base::ListValue); |
107 details->AppendStrings(task_log.details); | 107 details->AppendStrings(task_log.details); |
108 dict.Set("details", details.release()); | 108 dict.Set("details", details.release()); |
109 web_ui()->CallJavascriptFunction("TaskLog.onTaskLogRecorded", dict); | 109 web_ui()->CallJavascriptFunction("TaskLog.onTaskLogRecorded", dict); |
110 } | 110 } |
111 | 111 |
112 void SyncFileSystemInternalsHandler::GetServiceStatus( | 112 void SyncFileSystemInternalsHandler::GetServiceStatus( |
113 const base::ListValue* args) { | 113 const base::ListValue* args) { |
114 SyncServiceState state_enum = sync_file_system::SYNC_SERVICE_DISABLED; | 114 SyncServiceState state_enum = sync_file_system::SYNC_SERVICE_DISABLED; |
115 sync_file_system::SyncFileSystemService* sync_service = | 115 sync_file_system::SyncFileSystemService* sync_service = |
116 SyncFileSystemServiceFactory::GetForProfile(profile_); | 116 SyncFileSystemServiceFactory::GetForProfile(profile_); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 DCHECK(sync_service->task_logger()); | 183 DCHECK(sync_service->task_logger()); |
184 const sync_file_system::TaskLogger::LogList& log = | 184 const sync_file_system::TaskLogger::LogList& log = |
185 sync_service->task_logger()->GetLog(); | 185 sync_service->task_logger()->GetLog(); |
186 | 186 |
187 for (sync_file_system::TaskLogger::LogList::const_iterator itr = log.begin(); | 187 for (sync_file_system::TaskLogger::LogList::const_iterator itr = log.begin(); |
188 itr != log.end(); ++itr) | 188 itr != log.end(); ++itr) |
189 OnLogRecorded(**itr); | 189 OnLogRecorded(**itr); |
190 } | 190 } |
191 | 191 |
192 } // namespace syncfs_internals | 192 } // namespace syncfs_internals |
OLD | NEW |