Chromium Code Reviews| Index: components/devtools_bridge/client/web_client_controller.cc |
| diff --git a/components/devtools_bridge/client/web_client_controller.cc b/components/devtools_bridge/client/web_client_controller.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5bdad40a5af4f121a16eb452221cafa48517f1dc |
| --- /dev/null |
| +++ b/components/devtools_bridge/client/web_client_controller.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "components/devtools_bridge/client/web_client_controller.h" |
| + |
| +#include "base/memory/ref_counted_memory.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "content/public/browser/url_data_source.h" |
| +#include "content/public/browser/web_ui_data_source.h" |
| +#include "grit/devtools_bridge/web_client_resources_map.h" |
| +#include "net/url_request/url_request_context_getter.h" |
| +#include "ui/base/resource/resource_bundle.h" |
| + |
| +namespace devtools_bridge { |
| + |
| +WebClientController::WebClientController(content::WebUI* web_ui) |
| + : content::WebUIController(web_ui) { |
| + Profile* profile = Profile::FromWebUI(web_ui); |
| + |
| + 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
|
| + content::WebUIDataSource::Create("bridge"); |
| + source->DisableContentSecurityPolicy(); |
| + |
| + for (int i = 0; i != kWebClientSize; ++i) { |
| + source->AddResourcePath(kWebClient[i].name, kWebClient[i].value); |
| + } |
| + |
| + content::WebUIDataSource::Add(profile, source); |
| +} |
| + |
| +WebClientController::~WebClientController() { |
| +} |
| + |
| +} // devtools_bridge |