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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 weak_ptr_factory_.GetWeakPtr())); | 287 weak_ptr_factory_.GetWeakPtr())); |
288 } | 288 } |
289 | 289 |
290 } // namespace | 290 } // namespace |
291 | 291 |
292 GCMInternalsUI::GCMInternalsUI(content::WebUI* web_ui) | 292 GCMInternalsUI::GCMInternalsUI(content::WebUI* web_ui) |
293 : content::WebUIController(web_ui) { | 293 : content::WebUIController(web_ui) { |
294 // Set up the chrome://gcm-internals source. | 294 // Set up the chrome://gcm-internals source. |
295 content::WebUIDataSource* html_source = | 295 content::WebUIDataSource* html_source = |
296 content::WebUIDataSource::Create(chrome::kChromeUIGCMInternalsHost); | 296 content::WebUIDataSource::Create(chrome::kChromeUIGCMInternalsHost); |
297 html_source->SetUseJsonJSFormatV2(); | |
298 | 297 |
299 html_source->SetJsonPath("strings.js"); | 298 html_source->SetJsonPath("strings.js"); |
300 | 299 |
301 // Add required resources. | 300 // Add required resources. |
302 html_source->AddResourcePath("gcm_internals.css", IDR_GCM_INTERNALS_CSS); | 301 html_source->AddResourcePath("gcm_internals.css", IDR_GCM_INTERNALS_CSS); |
303 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); | 302 html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS); |
304 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); | 303 html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML); |
305 | 304 |
306 Profile* profile = Profile::FromWebUI(web_ui); | 305 Profile* profile = Profile::FromWebUI(web_ui); |
307 content::WebUIDataSource::Add(profile, html_source); | 306 content::WebUIDataSource::Add(profile, html_source); |
308 | 307 |
309 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); | 308 web_ui->AddMessageHandler(new GcmInternalsUIMessageHandler()); |
310 } | 309 } |
311 | 310 |
312 GCMInternalsUI::~GCMInternalsUI() {} | 311 GCMInternalsUI::~GCMInternalsUI() {} |
OLD | NEW |