Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/ui/webui/gcm_internals_ui.cc

Issue 248213004: Record connection, registration, and receiving activities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | google_apis/gcm/engine/connection_factory_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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() {}
OLDNEW
« no previous file with comments | « no previous file | google_apis/gcm/engine/connection_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698