| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 : WebUIController(web_ui), next_partition_id_(0) { | 330 : WebUIController(web_ui), next_partition_id_(0) { |
| 331 WebUIDataSource* source = | 331 WebUIDataSource* source = |
| 332 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost); | 332 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost); |
| 333 source->SetJsonPath("strings.js"); | 333 source->SetJsonPath("strings.js"); |
| 334 source->AddResourcePath("serviceworker_internals.js", | 334 source->AddResourcePath("serviceworker_internals.js", |
| 335 IDR_SERVICE_WORKER_INTERNALS_JS); | 335 IDR_SERVICE_WORKER_INTERNALS_JS); |
| 336 source->AddResourcePath("serviceworker_internals.css", | 336 source->AddResourcePath("serviceworker_internals.css", |
| 337 IDR_SERVICE_WORKER_INTERNALS_CSS); | 337 IDR_SERVICE_WORKER_INTERNALS_CSS); |
| 338 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML); | 338 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML); |
| 339 source->DisableDenyXFrameOptions(); | 339 source->DisableDenyXFrameOptions(); |
| 340 source->UseGzipForAllPaths(); |
| 340 | 341 |
| 341 BrowserContext* browser_context = | 342 BrowserContext* browser_context = |
| 342 web_ui->GetWebContents()->GetBrowserContext(); | 343 web_ui->GetWebContents()->GetBrowserContext(); |
| 343 WebUIDataSource::Add(browser_context, source); | 344 WebUIDataSource::Add(browser_context, source); |
| 344 | 345 |
| 345 web_ui->RegisterMessageCallback( | 346 web_ui->RegisterMessageCallback( |
| 346 "GetOptions", | 347 "GetOptions", |
| 347 base::Bind(&ServiceWorkerInternalsUI::GetOptions, | 348 base::Bind(&ServiceWorkerInternalsUI::GetOptions, |
| 348 base::Unretained(this))); | 349 base::Unretained(this))); |
| 349 web_ui->RegisterMessageCallback( | 350 web_ui->RegisterMessageCallback( |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 590 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
| 590 return; | 591 return; |
| 591 } | 592 } |
| 592 | 593 |
| 593 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here | 594 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here |
| 594 // because that reduces a status code to boolean. | 595 // because that reduces a status code to boolean. |
| 595 context->context()->UnregisterServiceWorker(scope, callback); | 596 context->context()->UnregisterServiceWorker(scope, callback); |
| 596 } | 597 } |
| 597 | 598 |
| 598 } // namespace content | 599 } // namespace content |
| OLD | NEW |