2013-11-08 16:06:06 +00:00
|
|
|
// Copyright 2013 the Chromium Embedded Framework Authors. Portions Copyright
|
|
|
|
// 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.
|
2012-04-03 01:34:16 +00:00
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_DELEGATE_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DELEGATE_H_
|
|
|
|
#pragma once
|
|
|
|
|
2013-01-15 19:12:28 +00:00
|
|
|
#include <map>
|
2012-04-03 01:34:16 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "base/basictypes.h"
|
|
|
|
#include "base/compiler_specific.h"
|
2012-04-26 22:20:18 +00:00
|
|
|
#include "base/memory/scoped_ptr.h"
|
2015-04-23 13:03:42 +03:00
|
|
|
#include "components/devtools_http_handler/devtools_http_handler.h"
|
|
|
|
#include "components/devtools_http_handler/devtools_http_handler_delegate.h"
|
2013-01-15 19:12:28 +00:00
|
|
|
#include "content/public/browser/devtools_agent_host.h"
|
2014-09-26 23:48:19 +00:00
|
|
|
#include "content/public/browser/devtools_manager_delegate.h"
|
2012-04-03 01:34:16 +00:00
|
|
|
|
|
|
|
namespace content {
|
2012-04-26 22:20:18 +00:00
|
|
|
class RenderViewHost;
|
2012-04-03 01:34:16 +00:00
|
|
|
}
|
|
|
|
|
2015-04-23 13:03:42 +03:00
|
|
|
class CefDevToolsDelegate :
|
|
|
|
public devtools_http_handler::DevToolsHttpHandlerDelegate {
|
2012-04-03 01:34:16 +00:00
|
|
|
public:
|
2014-12-13 20:18:31 +00:00
|
|
|
explicit CefDevToolsDelegate(uint16 port);
|
2014-11-12 19:25:15 +00:00
|
|
|
~CefDevToolsDelegate() override;
|
2012-04-03 01:34:16 +00:00
|
|
|
|
|
|
|
// Stops http server.
|
|
|
|
void Stop();
|
|
|
|
|
2014-09-26 23:48:19 +00:00
|
|
|
// DevToolsHttpHandlerDelegate overrides.
|
2014-11-12 19:25:15 +00:00
|
|
|
std::string GetDiscoveryPageHTML() override;
|
2015-04-23 13:03:42 +03:00
|
|
|
std::string GetFrontendResource(const std::string& path) override;
|
2015-06-05 18:06:48 -04:00
|
|
|
std::string GetPageThumbnailData(const GURL& url) override;
|
2015-10-09 11:23:12 -04:00
|
|
|
content::DevToolsExternalAgentProxyDelegate*
|
|
|
|
HandleWebSocketConnection(const std::string& path) override;
|
2012-04-03 01:34:16 +00:00
|
|
|
|
2013-11-08 16:06:06 +00:00
|
|
|
// Returns the chrome-devtools URL.
|
|
|
|
std::string GetChromeDevToolsURL();
|
|
|
|
|
2012-04-03 01:34:16 +00:00
|
|
|
private:
|
2015-04-23 13:03:42 +03:00
|
|
|
scoped_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
|
2012-04-03 01:34:16 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefDevToolsDelegate);
|
|
|
|
};
|
|
|
|
|
2014-09-26 23:48:19 +00:00
|
|
|
class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
|
|
|
|
public:
|
2015-03-02 20:25:14 +00:00
|
|
|
CefDevToolsManagerDelegate();
|
2014-11-12 19:25:15 +00:00
|
|
|
~CefDevToolsManagerDelegate() override;
|
2014-09-26 23:48:19 +00:00
|
|
|
|
|
|
|
// DevToolsManagerDelegate implementation.
|
2014-11-12 19:25:15 +00:00
|
|
|
void Inspect(content::BrowserContext* browser_context,
|
|
|
|
content::DevToolsAgentHost* agent_host) override {}
|
|
|
|
void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host,
|
|
|
|
bool attached) override {}
|
|
|
|
base::DictionaryValue* HandleCommand(
|
2014-09-26 23:48:19 +00:00
|
|
|
content::DevToolsAgentHost* agent_host,
|
2014-11-12 19:25:15 +00:00
|
|
|
base::DictionaryValue* command) override;
|
2014-09-26 23:48:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefDevToolsManagerDelegate);
|
|
|
|
};
|
|
|
|
|
2012-04-03 01:34:16 +00:00
|
|
|
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DELEGATE_H_
|