mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-07 14:33:40 +01:00
e7ddc933c9
- Remove |accept_lang| parameter from CefJSDialogHandler::OnJSDialog and CefFormatUrlForSecurityDisplay (see https://crbug.com/336973#c36). - Remove remaining NPAPI-related code including functions from cef_web_plugin.h (see https://crbug.com/493212#c55). - Mac: 10.7+ deployment target is now required for client applications. - Mac: Remove CefBrowserHost::SetWindowVisibility (issue #1375). No replacement is required for windowed rendering. Use WasHidden for off-screen rendering. - Windows: Visual Studio 2015 Update 2 is now required when building CEF/Chromium.
57 lines
1.5 KiB
C++
57 lines
1.5 KiB
C++
// Copyright (c) 2012 The Chromium Embedded Framework 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/net/devtools_scheme_handler.h"
|
|
|
|
#include <string>
|
|
|
|
#include "libcef/browser/net/internal_scheme_handler.h"
|
|
#include "libcef/browser/net/url_request_manager.h"
|
|
|
|
#include "base/memory/ptr_util.h"
|
|
#include "base/strings/string_util.h"
|
|
#include "content/public/common/url_constants.h"
|
|
#include "grit/devtools_resources_map.h"
|
|
|
|
namespace scheme {
|
|
|
|
const char kChromeDevToolsHost[] = "devtools";
|
|
|
|
namespace {
|
|
|
|
class Delegate : public InternalHandlerDelegate {
|
|
public:
|
|
Delegate() {}
|
|
|
|
bool OnRequest(CefRefPtr<CefBrowser> browser,
|
|
CefRefPtr<CefRequest> request,
|
|
Action* action) override {
|
|
GURL url = GURL(request->GetURL().ToString());
|
|
std::string path = url.path();
|
|
if (path.length() > 0)
|
|
path = path.substr(1);
|
|
|
|
for (size_t i = 0; i < kDevtoolsResourcesSize; ++i) {
|
|
if (base::EqualsCaseInsensitiveASCII(kDevtoolsResources[i].name,
|
|
path.c_str())) {
|
|
action->resource_id = kDevtoolsResources[i].value;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
};
|
|
|
|
} // namespace
|
|
|
|
void RegisterChromeDevToolsHandler(CefURLRequestManager* request_manager) {
|
|
request_manager->AddFactory(
|
|
content::kChromeDevToolsScheme,
|
|
kChromeDevToolsHost,
|
|
CreateInternalHandlerFactory(base::WrapUnique(new Delegate())));
|
|
}
|
|
|
|
} // namespace scheme
|