Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/devtools_bridge/client/web_client_controller.h" | |
| 6 | |
| 7 #include "base/memory/ref_counted_memory.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "content/public/browser/url_data_source.h" | |
| 10 #include "content/public/browser/web_ui_data_source.h" | |
| 11 #include "grit/devtools_bridge/web_client_resources_map.h" | |
| 12 #include "net/url_request/url_request_context_getter.h" | |
| 13 #include "ui/base/resource/resource_bundle.h" | |
| 14 | |
| 15 namespace devtools_bridge { | |
| 16 | |
| 17 WebClientController::WebClientController(content::WebUI* web_ui) | |
| 18 : content::WebUIController(web_ui) { | |
| 19 Profile* profile = Profile::FromWebUI(web_ui); | |
| 20 | |
| 21 content::WebUIDataSource* source = | |
|
Tom Sepez
2014/11/21 22:10:37
Ah, here's the part I was worried about. Does thi
SeRya
2014/11/24 11:10:06
It works in the test app because I do registering
| |
| 22 content::WebUIDataSource::Create("bridge"); | |
| 23 source->DisableContentSecurityPolicy(); | |
| 24 | |
| 25 for (int i = 0; i != kWebClientSize; ++i) { | |
| 26 source->AddResourcePath(kWebClient[i].name, kWebClient[i].value); | |
| 27 } | |
| 28 | |
| 29 content::WebUIDataSource::Add(profile, source); | |
| 30 } | |
| 31 | |
| 32 WebClientController::~WebClientController() { | |
| 33 } | |
| 34 | |
| 35 } // devtools_bridge | |
| OLD | NEW |