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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 : WebUIController(web_ui), next_partition_id_(0) { | 342 : WebUIController(web_ui), next_partition_id_(0) { |
343 WebUIDataSource* source = | 343 WebUIDataSource* source = |
344 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost); | 344 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost); |
345 source->SetJsonPath("strings.js"); | 345 source->SetJsonPath("strings.js"); |
346 source->AddResourcePath("serviceworker_internals.js", | 346 source->AddResourcePath("serviceworker_internals.js", |
347 IDR_SERVICE_WORKER_INTERNALS_JS); | 347 IDR_SERVICE_WORKER_INTERNALS_JS); |
348 source->AddResourcePath("serviceworker_internals.css", | 348 source->AddResourcePath("serviceworker_internals.css", |
349 IDR_SERVICE_WORKER_INTERNALS_CSS); | 349 IDR_SERVICE_WORKER_INTERNALS_CSS); |
350 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML); | 350 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML); |
351 source->DisableDenyXFrameOptions(); | 351 source->DisableDenyXFrameOptions(); |
352 source->DisableI18nAndUseGzipForAllPaths(); | 352 source->UseGzip(std::unordered_set<std::string>()); |
353 | 353 |
354 BrowserContext* browser_context = | 354 BrowserContext* browser_context = |
355 web_ui->GetWebContents()->GetBrowserContext(); | 355 web_ui->GetWebContents()->GetBrowserContext(); |
356 WebUIDataSource::Add(browser_context, source); | 356 WebUIDataSource::Add(browser_context, source); |
357 | 357 |
358 web_ui->RegisterMessageCallback( | 358 web_ui->RegisterMessageCallback( |
359 "GetOptions", | 359 "GetOptions", |
360 base::Bind(&ServiceWorkerInternalsUI::GetOptions, | 360 base::Bind(&ServiceWorkerInternalsUI::GetOptions, |
361 base::Unretained(this))); | 361 base::Unretained(this))); |
362 web_ui->RegisterMessageCallback( | 362 web_ui->RegisterMessageCallback( |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 602 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
603 return; | 603 return; |
604 } | 604 } |
605 | 605 |
606 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here | 606 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here |
607 // because that reduces a status code to boolean. | 607 // because that reduces a status code to boolean. |
608 context->context()->UnregisterServiceWorker(scope, callback); | 608 context->context()->UnregisterServiceWorker(scope, callback); |
609 } | 609 } |
610 | 610 |
611 } // namespace content | 611 } // namespace content |
OLD | NEW |