Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1000)

Side by Side Diff: content/browser/service_worker/service_worker_internals_ui.cc

Issue 298993003: Show ServiceWorkers in chrome://inspect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated kinuko's comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 : WebUIController(web_ui), next_partition_id_(0) { 191 : WebUIController(web_ui), next_partition_id_(0) {
192 WebUIDataSource* source = 192 WebUIDataSource* source =
193 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost); 193 WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost);
194 source->SetUseJsonJSFormatV2(); 194 source->SetUseJsonJSFormatV2();
195 source->SetJsonPath("strings.js"); 195 source->SetJsonPath("strings.js");
196 source->AddResourcePath("serviceworker_internals.js", 196 source->AddResourcePath("serviceworker_internals.js",
197 IDR_SERVICE_WORKER_INTERNALS_JS); 197 IDR_SERVICE_WORKER_INTERNALS_JS);
198 source->AddResourcePath("serviceworker_internals.css", 198 source->AddResourcePath("serviceworker_internals.css",
199 IDR_SERVICE_WORKER_INTERNALS_CSS); 199 IDR_SERVICE_WORKER_INTERNALS_CSS);
200 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML); 200 source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML);
201 source->DisableDenyXFrameOptions();
201 202
202 BrowserContext* browser_context = 203 BrowserContext* browser_context =
203 web_ui->GetWebContents()->GetBrowserContext(); 204 web_ui->GetWebContents()->GetBrowserContext();
204 WebUIDataSource::Add(browser_context, source); 205 WebUIDataSource::Add(browser_context, source);
205 206
206 web_ui->RegisterMessageCallback( 207 web_ui->RegisterMessageCallback(
207 "getAllRegistrations", 208 "getAllRegistrations",
208 base::Bind(&ServiceWorkerInternalsUI::GetAllRegistrations, 209 base::Bind(&ServiceWorkerInternalsUI::GetAllRegistrations,
209 base::Unretained(this))); 210 base::Unretained(this)));
210 web_ui->RegisterMessageCallback( 211 web_ui->RegisterMessageCallback(
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 DevToolsManagerImpl::GetInstance()->Inspect( 690 DevToolsManagerImpl::GetInstance()->Inspect(
690 internals_->web_ui()->GetWebContents()->GetBrowserContext(), 691 internals_->web_ui()->GetWebContents()->GetBrowserContext(),
691 agent_host.get()); 692 agent_host.get());
692 OperationComplete(SERVICE_WORKER_OK); 693 OperationComplete(SERVICE_WORKER_OK);
693 return; 694 return;
694 } 695 }
695 OperationComplete(SERVICE_WORKER_ERROR_NOT_FOUND); 696 OperationComplete(SERVICE_WORKER_ERROR_NOT_FOUND);
696 } 697 }
697 698
698 } // namespace content 699 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/resources/service_worker/serviceworker_internals.js ('k') | content/public/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698