OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gcm_internals_ui.h" | 5 #include "chrome/browser/ui/webui/gcm_internals_ui.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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 JoinString(stats->registered_app_ids, ",")); | 109 JoinString(stats->registered_app_ids, ",")); |
110 if (stats->connection_client_created) | 110 if (stats->connection_client_created) |
111 device_info->SetString("connectionState", stats->connection_state); | 111 device_info->SetString("connectionState", stats->connection_state); |
112 if (stats->android_id > 0) { | 112 if (stats->android_id > 0) { |
113 device_info->SetString("androidId", | 113 device_info->SetString("androidId", |
114 base::StringPrintf("0x%" PRIx64, stats->android_id)); | 114 base::StringPrintf("0x%" PRIx64, stats->android_id)); |
115 } | 115 } |
116 device_info->SetInteger("sendQueueSize", stats->send_queue_size); | 116 device_info->SetInteger("sendQueueSize", stats->send_queue_size); |
117 device_info->SetInteger("resendQueueSize", stats->resend_queue_size); | 117 device_info->SetInteger("resendQueueSize", stats->resend_queue_size); |
118 | 118 |
119 if (stats->sending_activities.size() > 0) { | 119 if (stats->recorded_activities.sending_activities.size() > 0) { |
120 base::ListValue* send_info = new base::ListValue(); | 120 base::ListValue* send_info = new base::ListValue(); |
121 results.Set("sendInfo", send_info); | 121 results.Set("sendInfo", send_info); |
122 SetSendingInfo(stats->sending_activities, send_info); | 122 SetSendingInfo(stats->recorded_activities.sending_activities, send_info); |
123 } | 123 } |
124 } | 124 } |
125 web_ui()->CallJavascriptFunction("gcmInternals.setGcmInternalsInfo", | 125 web_ui()->CallJavascriptFunction("gcmInternals.setGcmInternalsInfo", |
126 results); | 126 results); |
127 } | 127 } |
128 | 128 |
129 void GcmInternalsUIMessageHandler::RequestAllInfo( | 129 void GcmInternalsUIMessageHandler::RequestAllInfo( |
130 const base::ListValue* args) { | 130 const base::ListValue* args) { |
131 if (args->GetSize() != 1) { | 131 if (args->GetSize() != 1) { |
132 NOTREACHED(); | 132 NOTREACHED(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); | 222 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); |
223 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); | 223 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); |
224 | 224 |
225 Profile* profile = Profile::FromWebUI(web_ui); | 225 Profile* profile = Profile::FromWebUI(web_ui); |
226 content::WebUIDataSource::Add(profile, html_source); | 226 content::WebUIDataSource::Add(profile, html_source); |
227 | 227 |
228 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); | 228 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); |
229 } | 229 } |
230 | 230 |
231 GCMInternalsUI::~GCMInternalsUI() {} | 231 GCMInternalsUI::~GCMInternalsUI() {} |
OLD | NEW |