| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 device_info->SetBoolean("profileServiceCreated", profile_service != NULL); | 155 device_info->SetBoolean("profileServiceCreated", profile_service != NULL); |
| 156 device_info->SetBoolean("gcmEnabled", | 156 device_info->SetBoolean("gcmEnabled", |
| 157 gcm::GCMProfileService::IsGCMEnabled(profile)); | 157 gcm::GCMProfileService::IsGCMEnabled(profile)); |
| 158 if (stats) { | 158 if (stats) { |
| 159 results.SetBoolean("isRecording", stats->is_recording); | 159 results.SetBoolean("isRecording", stats->is_recording); |
| 160 device_info->SetBoolean("gcmClientCreated", stats->gcm_client_created); | 160 device_info->SetBoolean("gcmClientCreated", stats->gcm_client_created); |
| 161 device_info->SetString("gcmClientState", stats->gcm_client_state); | 161 device_info->SetString("gcmClientState", stats->gcm_client_state); |
| 162 device_info->SetBoolean("connectionClientCreated", | 162 device_info->SetBoolean("connectionClientCreated", |
| 163 stats->connection_client_created); | 163 stats->connection_client_created); |
| 164 device_info->SetString("registeredAppIds", | 164 device_info->SetString("registeredAppIds", |
| 165 JoinString(stats->registered_app_ids, ",")); | 165 base::JoinString(stats->registered_app_ids, ",")); |
| 166 if (stats->connection_client_created) | 166 if (stats->connection_client_created) |
| 167 device_info->SetString("connectionState", stats->connection_state); | 167 device_info->SetString("connectionState", stats->connection_state); |
| 168 if (stats->android_id > 0) { | 168 if (stats->android_id > 0) { |
| 169 device_info->SetString("androidId", | 169 device_info->SetString("androidId", |
| 170 base::StringPrintf("0x%" PRIx64, stats->android_id)); | 170 base::StringPrintf("0x%" PRIx64, stats->android_id)); |
| 171 } | 171 } |
| 172 device_info->SetInteger("sendQueueSize", stats->send_queue_size); | 172 device_info->SetInteger("sendQueueSize", stats->send_queue_size); |
| 173 device_info->SetInteger("resendQueueSize", stats->resend_queue_size); | 173 device_info->SetInteger("resendQueueSize", stats->resend_queue_size); |
| 174 | 174 |
| 175 if (stats->recorded_activities.checkin_activities.size() > 0) { | 175 if (stats->recorded_activities.checkin_activities.size() > 0) { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); | 295 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); |
| 296 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); | 296 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); |
| 297 | 297 |
| 298 Profile* profile = Profile::FromWebUI(web_ui); | 298 Profile* profile = Profile::FromWebUI(web_ui); |
| 299 content::WebUIDataSource::Add(profile, html_source); | 299 content::WebUIDataSource::Add(profile, html_source); |
| 300 | 300 |
| 301 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); | 301 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); |
| 302 } | 302 } |
| 303 | 303 |
| 304 GCMInternalsUI::~GCMInternalsUI() {} | 304 GCMInternalsUI::~GCMInternalsUI() {} |
| OLD | NEW |