| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Class acting as a controller of the chrome://gcm-internals WebUI. | 109 // Class acting as a controller of the chrome://gcm-internals WebUI. |
| 110 class GcmInternalsUIMessageHandler : public content::WebUIMessageHandler { | 110 class GcmInternalsUIMessageHandler : public content::WebUIMessageHandler { |
| 111 public: | 111 public: |
| 112 GcmInternalsUIMessageHandler(); | 112 GcmInternalsUIMessageHandler(); |
| 113 virtual ~GcmInternalsUIMessageHandler(); | 113 virtual ~GcmInternalsUIMessageHandler(); |
| 114 | 114 |
| 115 // WebUIMessageHandler implementation. | 115 // WebUIMessageHandler implementation. |
| 116 virtual void RegisterMessages() OVERRIDE; | 116 virtual void RegisterMessages() override; |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 // Return all of the GCM related infos to the gcm-internals page by calling | 119 // Return all of the GCM related infos to the gcm-internals page by calling |
| 120 // Javascript callback function | 120 // Javascript callback function |
| 121 // |gcm-internals.returnInfo()|. | 121 // |gcm-internals.returnInfo()|. |
| 122 void ReturnResults(Profile* profile, gcm::GCMProfileService* profile_service, | 122 void ReturnResults(Profile* profile, gcm::GCMProfileService* profile_service, |
| 123 const gcm::GCMClient::GCMStatistics* stats) const; | 123 const gcm::GCMClient::GCMStatistics* stats) const; |
| 124 | 124 |
| 125 // Request all of the GCM related infos through gcm profile service. | 125 // Request all of the GCM related infos through gcm profile service. |
| 126 void RequestAllInfo(const base::ListValue* args); | 126 void RequestAllInfo(const base::ListValue* args); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); | 302 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); |
| 303 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); | 303 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); |
| 304 | 304 |
| 305 Profile* profile = Profile::FromWebUI(web_ui); | 305 Profile* profile = Profile::FromWebUI(web_ui); |
| 306 content::WebUIDataSource::Add(profile, html_source); | 306 content::WebUIDataSource::Add(profile, html_source); |
| 307 | 307 |
| 308 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); | 308 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); |
| 309 } | 309 } |
| 310 | 310 |
| 311 GCMInternalsUI::~GCMInternalsUI() {} | 311 GCMInternalsUI::~GCMInternalsUI() {} |
| OLD | NEW |