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 "content/browser/service_worker/service_worker_internals_ui.h" | 5 #include "content/browser/service_worker/service_worker_internals_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 private: | 384 private: |
385 const int partition_id_; | 385 const int partition_id_; |
386 WebUI* const web_ui_; | 386 WebUI* const web_ui_; |
387 }; | 387 }; |
388 | 388 |
389 ServiceWorkerInternalsUI::ServiceWorkerInternalsUI(WebUI* web_ui) | 389 ServiceWorkerInternalsUI::ServiceWorkerInternalsUI(WebUI* web_ui) |
390 : WebUIController(web_ui), next_partition_id_(0) { | 390 : WebUIController(web_ui), next_partition_id_(0) { |
391 WebUIDataSource* source = | 391 WebUIDataSource* source = |
392 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost); | 392 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost); |
393 source->SetUseJsonJSFormatV2(); | |
394 source->SetJsonPath("strings.js"); | 393 source->SetJsonPath("strings.js"); |
395 source->AddResourcePath("serviceworker_internals.js", | 394 source->AddResourcePath("serviceworker_internals.js", |
396 IDR_SERVICE_WORKER_INTERNALS_JS); | 395 IDR_SERVICE_WORKER_INTERNALS_JS); |
397 source->AddResourcePath("serviceworker_internals.css", | 396 source->AddResourcePath("serviceworker_internals.css", |
398 IDR_SERVICE_WORKER_INTERNALS_CSS); | 397 IDR_SERVICE_WORKER_INTERNALS_CSS); |
399 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML); | 398 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML); |
400 source->DisableDenyXFrameOptions(); | 399 source->DisableDenyXFrameOptions(); |
401 | 400 |
402 BrowserContext* browser_context = | 401 BrowserContext* browser_context = |
403 web_ui->GetWebContents()->GetBrowserContext(); | 402 web_ui->GetWebContents()->GetBrowserContext(); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 return; | 666 return; |
668 } | 667 } |
669 | 668 |
670 base::Callback<void(ServiceWorkerStatusCode)> callback = | 669 base::Callback<void(ServiceWorkerStatusCode)> callback = |
671 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); | 670 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); |
672 FindRegistrationForPattern( | 671 FindRegistrationForPattern( |
673 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); | 672 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); |
674 } | 673 } |
675 | 674 |
676 } // namespace content | 675 } // namespace content |
OLD | NEW |