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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (!description.empty()) | 79 if (!description.empty()) |
80 state_string += " (" + description + ")"; | 80 state_string += " (" + description + ")"; |
81 | 81 |
82 // TODO(calvinlo): OnSyncStateUpdated should be updated to also provide the | 82 // TODO(calvinlo): OnSyncStateUpdated should be updated to also provide the |
83 // notification mechanism (XMPP or Polling). | 83 // notification mechanism (XMPP or Polling). |
84 web_ui()->CallJavascriptFunction("SyncService.onGetServiceStatus", | 84 web_ui()->CallJavascriptFunction("SyncService.onGetServiceStatus", |
85 base::StringValue(state_string)); | 85 base::StringValue(state_string)); |
86 } | 86 } |
87 | 87 |
88 void SyncFileSystemInternalsHandler::OnFileSynced( | 88 void SyncFileSystemInternalsHandler::OnFileSynced( |
89 const fileapi::FileSystemURL& url, | 89 const storage::FileSystemURL& url, |
90 sync_file_system::SyncFileStatus status, | 90 sync_file_system::SyncFileStatus status, |
91 sync_file_system::SyncAction action, | 91 sync_file_system::SyncAction action, |
92 sync_file_system::SyncDirection direction) {} | 92 sync_file_system::SyncDirection direction) { |
| 93 } |
93 | 94 |
94 void SyncFileSystemInternalsHandler::OnLogRecorded( | 95 void SyncFileSystemInternalsHandler::OnLogRecorded( |
95 const sync_file_system::TaskLogger::TaskLog& task_log) { | 96 const sync_file_system::TaskLogger::TaskLog& task_log) { |
96 base::DictionaryValue dict; | 97 base::DictionaryValue dict; |
97 int64 duration = (task_log.end_time - task_log.start_time).InMilliseconds(); | 98 int64 duration = (task_log.end_time - task_log.start_time).InMilliseconds(); |
98 dict.SetInteger("duration", duration); | 99 dict.SetInteger("duration", duration); |
99 dict.SetString("task_description", task_log.task_description); | 100 dict.SetString("task_description", task_log.task_description); |
100 dict.SetString("result_description", task_log.result_description); | 101 dict.SetString("result_description", task_log.result_description); |
101 | 102 |
102 scoped_ptr<base::ListValue> details(new base::ListValue); | 103 scoped_ptr<base::ListValue> details(new base::ListValue); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 DCHECK(sync_service->task_logger()); | 180 DCHECK(sync_service->task_logger()); |
180 const sync_file_system::TaskLogger::LogList& log = | 181 const sync_file_system::TaskLogger::LogList& log = |
181 sync_service->task_logger()->GetLog(); | 182 sync_service->task_logger()->GetLog(); |
182 | 183 |
183 for (sync_file_system::TaskLogger::LogList::const_iterator itr = log.begin(); | 184 for (sync_file_system::TaskLogger::LogList::const_iterator itr = log.begin(); |
184 itr != log.end(); ++itr) | 185 itr != log.end(); ++itr) |
185 OnLogRecorded(**itr); | 186 OnLogRecorded(**itr); |
186 } | 187 } |
187 | 188 |
188 } // namespace syncfs_internals | 189 } // namespace syncfs_internals |
OLD | NEW |