mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-01 03:47:05 +01:00
f94336aade
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@578 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
// Copyright (c) 2012 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 "libcef/browser/devtools_delegate.h"
|
|
|
|
#include <algorithm>
|
|
|
|
#include "content/public/browser/devtools_http_handler.h"
|
|
#include "content/public/common/content_client.h"
|
|
#include "grit/cef_resources.h"
|
|
#include "net/url_request/url_request_context_getter.h"
|
|
#include "ui/base/resource/resource_bundle.h"
|
|
|
|
CefDevToolsDelegate::CefDevToolsDelegate(
|
|
int port,
|
|
net::URLRequestContextGetter* context_getter) {
|
|
devtools_http_handler_ = content::DevToolsHttpHandler::Start(
|
|
"127.0.0.1",
|
|
port,
|
|
"",
|
|
context_getter,
|
|
this);
|
|
}
|
|
|
|
CefDevToolsDelegate::~CefDevToolsDelegate() {
|
|
}
|
|
|
|
void CefDevToolsDelegate::Stop() {
|
|
// The call below destroys this.
|
|
devtools_http_handler_->Stop();
|
|
}
|
|
|
|
std::string CefDevToolsDelegate::GetDiscoveryPageHTML() {
|
|
return content::GetContentClient()->GetDataResource(
|
|
IDR_CEF_DEVTOOLS_DISCOVERY_PAGE).as_string();
|
|
}
|
|
|
|
bool CefDevToolsDelegate::BundlesFrontendResources() {
|
|
return true;
|
|
}
|
|
|
|
std::string CefDevToolsDelegate::GetFrontendResourcesBaseURL() {
|
|
return "";
|
|
}
|