commit
17e94cd8dc
23 changed files with 110 additions and 172 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
'variables': {
|
'variables': {
|
||||||
# The libraries brightray will be compiled to.
|
# The libraries brightray will be compiled to.
|
||||||
'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss'
|
'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss'
|
||||||
},
|
},
|
||||||
'includes': [
|
'includes': [
|
||||||
'filenames.gypi',
|
'filenames.gypi',
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
'.',
|
'.',
|
||||||
'<(libchromiumcontent_src_dir)',
|
'<(libchromiumcontent_src_dir)',
|
||||||
'<(libchromiumcontent_src_dir)/skia/config',
|
'<(libchromiumcontent_src_dir)/skia/config',
|
||||||
|
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/WebKit',
|
'<(libchromiumcontent_src_dir)/third_party/WebKit',
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
'<(libchromiumcontent_src_dir)',
|
'<(libchromiumcontent_src_dir)',
|
||||||
'<(libchromiumcontent_src_dir)/gpu',
|
'<(libchromiumcontent_src_dir)/gpu',
|
||||||
'<(libchromiumcontent_src_dir)/skia/config',
|
'<(libchromiumcontent_src_dir)/skia/config',
|
||||||
|
'<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/config',
|
'<(libchromiumcontent_src_dir)/third_party/skia/include/config',
|
||||||
'<(libchromiumcontent_src_dir)/third_party/icu/source/common',
|
'<(libchromiumcontent_src_dir)/third_party/icu/source/common',
|
||||||
|
@ -67,7 +69,7 @@
|
||||||
},
|
},
|
||||||
'cflags': [
|
'cflags': [
|
||||||
'<!@(<(pkg-config) --cflags <(linux_system_libraries))',
|
'<!@(<(pkg-config) --cflags <(linux_system_libraries))',
|
||||||
# Needed by using libgtk2ui:
|
# Needed by using libgtkui:
|
||||||
'-Wno-deprecated-register',
|
'-Wno-deprecated-register',
|
||||||
'-Wno-sentinel',
|
'-Wno-sentinel',
|
||||||
],
|
],
|
||||||
|
@ -86,9 +88,7 @@
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [
|
'libraries': [
|
||||||
# Following libraries are always linked statically.
|
# Following libraries are always linked statically.
|
||||||
'<(libchromiumcontent_dir)/libgtk2ui.a',
|
'<(libchromiumcontent_dir)/libgtkui.a',
|
||||||
'<(libchromiumcontent_dir)/libdevtools_discovery.a',
|
|
||||||
'<(libchromiumcontent_dir)/libdevtools_http_handler.a',
|
|
||||||
'<(libchromiumcontent_dir)/libhttp_server.a',
|
'<(libchromiumcontent_dir)/libhttp_server.a',
|
||||||
'<(libchromiumcontent_dir)/libdesktop_capture.a',
|
'<(libchromiumcontent_dir)/libdesktop_capture.a',
|
||||||
'<(libchromiumcontent_dir)/libdom_keycode_converter.a',
|
'<(libchromiumcontent_dir)/libdom_keycode_converter.a',
|
||||||
|
@ -142,8 +142,6 @@
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [
|
'libraries': [
|
||||||
# Following libraries are always linked statically.
|
# Following libraries are always linked statically.
|
||||||
'<(libchromiumcontent_dir)/libdevtools_discovery.a',
|
|
||||||
'<(libchromiumcontent_dir)/libdevtools_http_handler.a',
|
|
||||||
'<(libchromiumcontent_dir)/libhttp_server.a',
|
'<(libchromiumcontent_dir)/libhttp_server.a',
|
||||||
'<(libchromiumcontent_dir)/libdesktop_capture.a',
|
'<(libchromiumcontent_dir)/libdesktop_capture.a',
|
||||||
'<(libchromiumcontent_dir)/libdom_keycode_converter.a',
|
'<(libchromiumcontent_dir)/libdom_keycode_converter.a',
|
||||||
|
@ -193,6 +191,8 @@
|
||||||
'-lsandbox',
|
'-lsandbox',
|
||||||
# bluetooth.gyp:
|
# bluetooth.gyp:
|
||||||
'$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework',
|
'$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework',
|
||||||
|
# components/wifi/BUILD.gn:
|
||||||
|
'$(SDKROOT)/System/Library/Frameworks/CoreWLAN.framework',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
|
@ -210,8 +210,6 @@
|
||||||
'<(libchromiumcontent_dir)/base_static.lib',
|
'<(libchromiumcontent_dir)/base_static.lib',
|
||||||
'<(libchromiumcontent_dir)/sandbox.lib',
|
'<(libchromiumcontent_dir)/sandbox.lib',
|
||||||
'<(libchromiumcontent_dir)/sandbox_helper_win.lib',
|
'<(libchromiumcontent_dir)/sandbox_helper_win.lib',
|
||||||
'<(libchromiumcontent_dir)/devtools_discovery.lib',
|
|
||||||
'<(libchromiumcontent_dir)/devtools_http_handler.lib',
|
|
||||||
'<(libchromiumcontent_dir)/http_server.lib',
|
'<(libchromiumcontent_dir)/http_server.lib',
|
||||||
'<(libchromiumcontent_dir)/desktop_capture.lib',
|
'<(libchromiumcontent_dir)/desktop_capture.lib',
|
||||||
'<(libchromiumcontent_dir)/dom_keycode_converter.lib',
|
'<(libchromiumcontent_dir)/dom_keycode_converter.lib',
|
||||||
|
@ -296,12 +294,15 @@
|
||||||
# net_common.gypi:
|
# net_common.gypi:
|
||||||
'crypt32.lib',
|
'crypt32.lib',
|
||||||
'dhcpcsvc.lib',
|
'dhcpcsvc.lib',
|
||||||
|
'ncrypt.lib',
|
||||||
'rpcrt4.lib',
|
'rpcrt4.lib',
|
||||||
'secur32.lib',
|
'secur32.lib',
|
||||||
'urlmon.lib',
|
'urlmon.lib',
|
||||||
'winhttp.lib',
|
'winhttp.lib',
|
||||||
# ui/gfx/BUILD.gn:
|
# ui/gfx/BUILD.gn:
|
||||||
'dwrite.lib',
|
'dwrite.lib',
|
||||||
|
# skia/BUILD.gn:
|
||||||
|
'fontsub.lib',
|
||||||
],
|
],
|
||||||
'DelayLoadDLLs': [
|
'DelayLoadDLLs': [
|
||||||
'wtsapi32.dll',
|
'wtsapi32.dll',
|
||||||
|
|
|
@ -140,8 +140,8 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
|
||||||
static_cast<NetLog*>(BrowserClient::Get()->GetNetLog()),
|
static_cast<NetLog*>(BrowserClient::Get()->GetNetLog()),
|
||||||
GetPath(),
|
GetPath(),
|
||||||
in_memory_,
|
in_memory_,
|
||||||
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
|
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
|
||||||
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE),
|
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
|
||||||
protocol_handlers,
|
protocol_handlers,
|
||||||
std::move(protocol_interceptors));
|
std::move(protocol_interceptors));
|
||||||
resource_context_->set_url_request_context_getter(url_request_getter_.get());
|
resource_context_->set_url_request_context_getter(url_request_getter_.get());
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "base/feature_list.h"
|
#include "base/feature_list.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "components/devtools_http_handler/devtools_http_handler.h"
|
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "media/base/media_resources.h"
|
#include "media/base/media_resources.h"
|
||||||
|
@ -37,7 +36,7 @@
|
||||||
#include "base/nix/xdg_util.h"
|
#include "base/nix/xdg_util.h"
|
||||||
#include "base/threading/thread_task_runner_handle.h"
|
#include "base/threading/thread_task_runner_handle.h"
|
||||||
#include "browser/brightray_paths.h"
|
#include "browser/brightray_paths.h"
|
||||||
#include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
|
#include "chrome/browser/ui/libgtkui/gtk_ui.h"
|
||||||
#include "ui/base/x/x11_util.h"
|
#include "ui/base/x/x11_util.h"
|
||||||
#include "ui/base/x/x11_util_internal.h"
|
#include "ui/base/x/x11_util_internal.h"
|
||||||
#include "ui/views/linux_ui/linux_ui.h"
|
#include "ui/views/linux_ui/linux_ui.h"
|
||||||
|
@ -216,7 +215,7 @@ void BrowserMainParts::PreMainMessageLoopRun() {
|
||||||
// --remote-debugging-port
|
// --remote-debugging-port
|
||||||
auto command_line = base::CommandLine::ForCurrentProcess();
|
auto command_line = base::CommandLine::ForCurrentProcess();
|
||||||
if (command_line->HasSwitch(switches::kRemoteDebuggingPort))
|
if (command_line->HasSwitch(switches::kRemoteDebuggingPort))
|
||||||
devtools_http_handler_.reset(DevToolsManagerDelegate::CreateHttpHandler());
|
DevToolsManagerDelegate::StartHttpHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserMainParts::PostMainMessageLoopStart() {
|
void BrowserMainParts::PostMainMessageLoopStart() {
|
||||||
|
@ -245,8 +244,7 @@ int BrowserMainParts::PreCreateThreads() {
|
||||||
display::Screen* screen = views::CreateDesktopScreen();
|
display::Screen* screen = views::CreateDesktopScreen();
|
||||||
display::Screen::SetScreenInstance(screen);
|
display::Screen::SetScreenInstance(screen);
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
views::LinuxUI::instance()->UpdateDeviceScaleFactor(
|
views::LinuxUI::instance()->UpdateDeviceScaleFactor();
|
||||||
screen->GetPrimaryDisplay().device_scale_factor());
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "content/public/browser/browser_main_parts.h"
|
#include "content/public/browser/browser_main_parts.h"
|
||||||
|
|
||||||
namespace devtools_http_handler {
|
|
||||||
class DevToolsHttpHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
class ViewsDelegate;
|
class ViewsDelegate;
|
||||||
|
@ -48,8 +44,6 @@ class BrowserMainParts : public content::BrowserMainParts {
|
||||||
void InitializeMainNib();
|
void InitializeMainNib();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::unique_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
|
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
std::unique_ptr<ViewsDelegate> views_delegate_;
|
std::unique_ptr<ViewsDelegate> views_delegate_;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,11 +15,9 @@
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "common/content_client.h"
|
#include "common/content_client.h"
|
||||||
#include "components/devtools_discovery/basic_target_descriptor.h"
|
|
||||||
#include "components/devtools_discovery/devtools_discovery_manager.h"
|
|
||||||
#include "components/devtools_http_handler/devtools_http_handler.h"
|
|
||||||
#include "content/public/browser/devtools_agent_host.h"
|
#include "content/public/browser/devtools_agent_host.h"
|
||||||
#include "content/public/browser/devtools_frontend_host.h"
|
#include "content/public/browser/devtools_frontend_host.h"
|
||||||
|
#include "content/public/browser/devtools_socket_factory.h"
|
||||||
#include "content/public/browser/favicon_status.h"
|
#include "content/public/browser/favicon_status.h"
|
||||||
#include "content/public/browser/navigation_entry.h"
|
#include "content/public/browser/navigation_entry.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
|
@ -36,23 +34,26 @@ namespace brightray {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class TCPServerSocketFactory
|
class TCPServerSocketFactory : public content::DevToolsSocketFactory {
|
||||||
: public devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory {
|
|
||||||
public:
|
public:
|
||||||
TCPServerSocketFactory(const std::string& address, int port)
|
TCPServerSocketFactory(const std::string& address, int port)
|
||||||
: address_(address), port_(port) {
|
: address_(address), port_(port) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// content::DevToolsHttpHandler::ServerSocketFactory.
|
// content::ServerSocketFactory.
|
||||||
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
|
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
|
||||||
std::unique_ptr<net::ServerSocket> socket(
|
std::unique_ptr<net::ServerSocket> socket(
|
||||||
new net::TCPServerSocket(nullptr, net::NetLog::Source()));
|
new net::TCPServerSocket(nullptr, net::NetLogSource()));
|
||||||
if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK)
|
if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK)
|
||||||
return std::unique_ptr<net::ServerSocket>();
|
return std::unique_ptr<net::ServerSocket>();
|
||||||
|
|
||||||
return socket;
|
return socket;
|
||||||
}
|
}
|
||||||
|
std::unique_ptr<net::ServerSocket> CreateForTethering(
|
||||||
|
std::string* name) override {
|
||||||
|
return std::unique_ptr<net::ServerSocket>();
|
||||||
|
}
|
||||||
|
|
||||||
std::string address_;
|
std::string address_;
|
||||||
uint16_t port_;
|
uint16_t port_;
|
||||||
|
@ -60,7 +61,7 @@ class TCPServerSocketFactory
|
||||||
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
|
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
|
std::unique_ptr<content::DevToolsSocketFactory>
|
||||||
CreateSocketFactory() {
|
CreateSocketFactory() {
|
||||||
auto& command_line = *base::CommandLine::ForCurrentProcess();
|
auto& command_line = *base::CommandLine::ForCurrentProcess();
|
||||||
// See if the user specified a port on the command line (useful for
|
// See if the user specified a port on the command line (useful for
|
||||||
|
@ -77,68 +78,19 @@ CreateSocketFactory() {
|
||||||
DLOG(WARNING) << "Invalid http debugger port number " << temp_port;
|
DLOG(WARNING) << "Invalid http debugger port number " << temp_port;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return std::unique_ptr<
|
return std::unique_ptr<content::DevToolsSocketFactory>(
|
||||||
devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>(
|
|
||||||
new TCPServerSocketFactory("127.0.0.1", port));
|
new TCPServerSocketFactory("127.0.0.1", port));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DevToolsDelegate --------------------------------------------------------
|
|
||||||
|
|
||||||
class DevToolsDelegate :
|
|
||||||
public devtools_http_handler::DevToolsHttpHandlerDelegate {
|
|
||||||
public:
|
|
||||||
DevToolsDelegate();
|
|
||||||
~DevToolsDelegate() override;
|
|
||||||
|
|
||||||
// devtools_http_handler::DevToolsHttpHandlerDelegate.
|
|
||||||
std::string GetDiscoveryPageHTML() override;
|
|
||||||
std::string GetFrontendResource(const std::string& path) override;
|
|
||||||
std::string GetPageThumbnailData(const GURL& url) override;
|
|
||||||
content::DevToolsExternalAgentProxyDelegate* HandleWebSocketConnection(
|
|
||||||
const std::string& path) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(DevToolsDelegate);
|
|
||||||
};
|
|
||||||
|
|
||||||
DevToolsDelegate::DevToolsDelegate() {
|
|
||||||
}
|
|
||||||
|
|
||||||
DevToolsDelegate::~DevToolsDelegate() {
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string DevToolsDelegate::GetDiscoveryPageHTML() {
|
|
||||||
return ResourceBundle::GetSharedInstance().GetRawDataResource(
|
|
||||||
IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string DevToolsDelegate::GetFrontendResource(
|
|
||||||
const std::string& path) {
|
|
||||||
return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string DevToolsDelegate::GetPageThumbnailData(const GURL& url) {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
content::DevToolsExternalAgentProxyDelegate*
|
|
||||||
DevToolsDelegate::HandleWebSocketConnection(const std::string& path) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// DevToolsManagerDelegate ---------------------------------------------------
|
// DevToolsManagerDelegate ---------------------------------------------------
|
||||||
|
|
||||||
// static
|
// static
|
||||||
devtools_http_handler::DevToolsHttpHandler*
|
void DevToolsManagerDelegate::StartHttpHandler() {
|
||||||
DevToolsManagerDelegate::CreateHttpHandler() {
|
content::DevToolsAgentHost::StartRemoteDebuggingServer(
|
||||||
return new devtools_http_handler::DevToolsHttpHandler(
|
|
||||||
CreateSocketFactory(),
|
CreateSocketFactory(),
|
||||||
std::string(),
|
std::string(),
|
||||||
new DevToolsDelegate,
|
|
||||||
base::FilePath(),
|
base::FilePath(),
|
||||||
base::FilePath(),
|
base::FilePath(),
|
||||||
std::string(),
|
std::string(),
|
||||||
|
@ -147,21 +99,12 @@ DevToolsManagerDelegate::CreateHttpHandler() {
|
||||||
|
|
||||||
DevToolsManagerDelegate::DevToolsManagerDelegate()
|
DevToolsManagerDelegate::DevToolsManagerDelegate()
|
||||||
: handler_(new DevToolsNetworkProtocolHandler) {
|
: handler_(new DevToolsNetworkProtocolHandler) {
|
||||||
// NB(zcbenz): This call does nothing, the only purpose is to make sure the
|
|
||||||
// devtools_discovery module is linked into the final executable on Linux.
|
|
||||||
// Though it is possible to achieve this by modifying the gyp settings, it
|
|
||||||
// would greatly increase gyp file's complexity, so I chose to instead do
|
|
||||||
// this hack.
|
|
||||||
devtools_discovery::DevToolsDiscoveryManager::GetInstance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DevToolsManagerDelegate::~DevToolsManagerDelegate() {
|
DevToolsManagerDelegate::~DevToolsManagerDelegate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DevToolsManagerDelegate::DevToolsAgentStateChanged(
|
void DevToolsManagerDelegate::Inspect(content::DevToolsAgentHost* agent_host) {
|
||||||
content::DevToolsAgentHost* agent_host,
|
|
||||||
bool attached) {
|
|
||||||
handler_->DevToolsAgentStateChanged(agent_host, attached);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* DevToolsManagerDelegate::HandleCommand(
|
base::DictionaryValue* DevToolsManagerDelegate::HandleCommand(
|
||||||
|
@ -170,4 +113,19 @@ base::DictionaryValue* DevToolsManagerDelegate::HandleCommand(
|
||||||
return handler_->HandleCommand(agent_host, command);
|
return handler_->HandleCommand(agent_host, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scoped_refptr<content::DevToolsAgentHost>
|
||||||
|
DevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DevToolsManagerDelegate::GetDiscoveryPageHTML() {
|
||||||
|
return ResourceBundle::GetSharedInstance().GetRawDataResource(
|
||||||
|
IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DevToolsManagerDelegate::GetFrontendResource(
|
||||||
|
const std::string& path) {
|
||||||
|
return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace brightray
|
} // namespace brightray
|
||||||
|
|
|
@ -7,31 +7,29 @@
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "components/devtools_http_handler/devtools_http_handler_delegate.h"
|
#include "content/browser/devtools/devtools_http_handler.h"
|
||||||
#include "content/public/browser/devtools_manager_delegate.h"
|
#include "content/public/browser/devtools_manager_delegate.h"
|
||||||
|
|
||||||
namespace devtools_http_handler {
|
|
||||||
class DevToolsHttpHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
class DevToolsNetworkProtocolHandler;
|
class DevToolsNetworkProtocolHandler;
|
||||||
|
|
||||||
class DevToolsManagerDelegate : public content::DevToolsManagerDelegate {
|
class DevToolsManagerDelegate : public content::DevToolsManagerDelegate {
|
||||||
public:
|
public:
|
||||||
static devtools_http_handler::DevToolsHttpHandler* CreateHttpHandler();
|
static void StartHttpHandler();
|
||||||
|
|
||||||
DevToolsManagerDelegate();
|
DevToolsManagerDelegate();
|
||||||
virtual ~DevToolsManagerDelegate();
|
virtual ~DevToolsManagerDelegate();
|
||||||
|
|
||||||
// DevToolsManagerDelegate implementation.
|
// DevToolsManagerDelegate implementation.
|
||||||
void Inspect(content::BrowserContext* browser_context,
|
void Inspect(content::DevToolsAgentHost* agent_host) override;
|
||||||
content::DevToolsAgentHost* agent_host) override {}
|
base::DictionaryValue* HandleCommand(
|
||||||
void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host,
|
content::DevToolsAgentHost* agent_host,
|
||||||
bool attached) override;
|
|
||||||
base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host,
|
|
||||||
base::DictionaryValue* command) override;
|
base::DictionaryValue* command) override;
|
||||||
|
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(
|
||||||
|
const GURL& url) override;
|
||||||
|
std::string GetDiscoveryPageHTML() override;
|
||||||
|
std::string GetFrontendResource(const std::string& path) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<DevToolsNetworkProtocolHandler> handler_;
|
std::unique_ptr<DevToolsNetworkProtocolHandler> handler_;
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
#include "content/public/browser/web_ui.h"
|
#include "content/public/browser/web_ui.h"
|
||||||
|
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -62,9 +61,9 @@ class BundledDataSource : public content::URLDataSource {
|
||||||
return kChromeUIDevToolsHost;
|
return kChromeUIDevToolsHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartDataRequest(const std::string& path,
|
void StartDataRequest(
|
||||||
int render_process_id,
|
const std::string& path,
|
||||||
int render_frame_id,
|
const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
|
||||||
const GotDataCallback& callback) override {
|
const GotDataCallback& callback) override {
|
||||||
// Serve request from local bundle.
|
// Serve request from local bundle.
|
||||||
std::string bundled_path_prefix(kChromeUIDevToolsBundledPath);
|
std::string bundled_path_prefix(kChromeUIDevToolsBundledPath);
|
||||||
|
@ -72,9 +71,11 @@ class BundledDataSource : public content::URLDataSource {
|
||||||
if (base::StartsWith(path, bundled_path_prefix,
|
if (base::StartsWith(path, bundled_path_prefix,
|
||||||
base::CompareCase::INSENSITIVE_ASCII)) {
|
base::CompareCase::INSENSITIVE_ASCII)) {
|
||||||
StartBundledDataRequest(path.substr(bundled_path_prefix.length()),
|
StartBundledDataRequest(path.substr(bundled_path_prefix.length()),
|
||||||
render_process_id, render_frame_id, callback);
|
callback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We do not handle remote and custom requests.
|
||||||
callback.Run(nullptr);
|
callback.Run(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,11 +95,8 @@ class BundledDataSource : public content::URLDataSource {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartBundledDataRequest(
|
void StartBundledDataRequest(const std::string& path,
|
||||||
const std::string& path,
|
const GotDataCallback& callback) {
|
||||||
int render_process_id,
|
|
||||||
int render_frame_id,
|
|
||||||
const content::URLDataSource::GotDataCallback& callback) {
|
|
||||||
std::string filename = PathWithoutParams(path);
|
std::string filename = PathWithoutParams(path);
|
||||||
base::StringPiece resource =
|
base::StringPiece resource =
|
||||||
content::DevToolsFrontendHost::GetFrontendResource(filename);
|
content::DevToolsFrontendHost::GetFrontendResource(filename);
|
||||||
|
|
|
@ -144,7 +144,7 @@ class ResponseWriter : public net::URLFetcherResponseWriter {
|
||||||
int Write(net::IOBuffer* buffer,
|
int Write(net::IOBuffer* buffer,
|
||||||
int num_bytes,
|
int num_bytes,
|
||||||
const net::CompletionCallback& callback) override;
|
const net::CompletionCallback& callback) override;
|
||||||
int Finish(const net::CompletionCallback& callback) override;
|
int Finish(int net_error, const net::CompletionCallback& callback) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
base::WeakPtr<InspectableWebContentsImpl> bindings_;
|
base::WeakPtr<InspectableWebContentsImpl> bindings_;
|
||||||
|
@ -181,7 +181,8 @@ int ResponseWriter::Write(net::IOBuffer* buffer,
|
||||||
return num_bytes;
|
return num_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ResponseWriter::Finish(const net::CompletionCallback& callback) {
|
int ResponseWriter::Finish(int net_error,
|
||||||
|
const net::CompletionCallback& callback) {
|
||||||
return net::OK;
|
return net::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,7 +395,7 @@ void InspectableWebContentsImpl::LoadCompleted() {
|
||||||
base::RemoveChars(current_dock_state, "\"", &dock_state_);
|
base::RemoveChars(current_dock_state, "\"", &dock_state_);
|
||||||
}
|
}
|
||||||
base::string16 javascript = base::UTF8ToUTF16(
|
base::string16 javascript = base::UTF8ToUTF16(
|
||||||
"WebInspector.dockController.setDockSide(\"" + dock_state_ + "\");");
|
"Components.dockController.setDockSide(\"" + dock_state_ + "\");");
|
||||||
devtools_web_contents_->GetMainFrame()->ExecuteJavaScript(javascript);
|
devtools_web_contents_->GetMainFrame()->ExecuteJavaScript(javascript);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -654,7 +655,7 @@ void InspectableWebContentsImpl::WebContentsDestroyed() {
|
||||||
view_->GetDelegate()->DevToolsClosed();
|
view_->GetDelegate()->DevToolsClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InspectableWebContentsImpl::AddMessageToConsole(
|
bool InspectableWebContentsImpl::DidAddMessageToConsole(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
int32_t level,
|
int32_t level,
|
||||||
const base::string16& message,
|
const base::string16& message,
|
||||||
|
@ -726,7 +727,7 @@ void InspectableWebContentsImpl::OnWebContentsFocused() {
|
||||||
|
|
||||||
void InspectableWebContentsImpl::DidStartNavigationToPendingEntry(
|
void InspectableWebContentsImpl::DidStartNavigationToPendingEntry(
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
content::NavigationController::ReloadType reload_type) {
|
content::ReloadType reload_type) {
|
||||||
frontend_host_.reset(
|
frontend_host_.reset(
|
||||||
content::DevToolsFrontendHost::Create(
|
content::DevToolsFrontendHost::Create(
|
||||||
web_contents()->GetMainFrame(),
|
web_contents()->GetMainFrame(),
|
||||||
|
|
|
@ -133,10 +133,10 @@ class InspectableWebContentsImpl :
|
||||||
void OnWebContentsFocused() override;
|
void OnWebContentsFocused() override;
|
||||||
void DidStartNavigationToPendingEntry(
|
void DidStartNavigationToPendingEntry(
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
content::NavigationController::ReloadType reload_type) override;
|
content::ReloadType reload_type) override;
|
||||||
|
|
||||||
// content::WebContentsDelegate:
|
// content::WebContentsDelegate:
|
||||||
bool AddMessageToConsole(content::WebContents* source,
|
bool DidAddMessageToConsole(content::WebContents* source,
|
||||||
int32_t level,
|
int32_t level,
|
||||||
const base::string16& message,
|
const base::string16& message,
|
||||||
int32_t line_no,
|
int32_t line_no,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "base/strings/string_util.h"
|
#include "base/strings/string_util.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "browser/notification_delegate.h"
|
#include "browser/notification_delegate.h"
|
||||||
#include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h"
|
#include "chrome/browser/ui/libgtkui/skia_utils_gtk.h"
|
||||||
#include "common/application_info.h"
|
#include "common/application_info.h"
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
#include "third_party/skia/include/core/SkBitmap.h"
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ void LibnotifyNotification::Show(const base::string16& title,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!icon.drawsNothing()) {
|
if (!icon.drawsNothing()) {
|
||||||
GdkPixbuf* pixbuf = libgtk2ui::GdkPixbufFromSkBitmap(icon);
|
GdkPixbuf* pixbuf = libgtkui::GdkPixbufFromSkBitmap(icon);
|
||||||
libnotify_loader_.notify_notification_set_image_from_pixbuf(
|
libnotify_loader_.notify_notification_set_image_from_pixbuf(
|
||||||
notification_, pixbuf);
|
notification_, pixbuf);
|
||||||
libnotify_loader_.notify_notification_set_timeout(
|
libnotify_loader_.notify_notification_set_timeout(
|
||||||
|
|
|
@ -137,10 +137,6 @@ void MediaStreamDevicesController::Accept() {
|
||||||
webcam_requested_,
|
webcam_requested_,
|
||||||
&devices);
|
&devices);
|
||||||
break;
|
break;
|
||||||
case content::MEDIA_ENUMERATE_DEVICES:
|
|
||||||
// Do nothing.
|
|
||||||
NOTREACHED();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,10 +103,9 @@ bool DevToolsNetworkTransaction::CheckFailed() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DevToolsNetworkTransaction::Start(
|
int DevToolsNetworkTransaction::Start(const net::HttpRequestInfo* request,
|
||||||
const net::HttpRequestInfo* request,
|
|
||||||
const net::CompletionCallback& callback,
|
const net::CompletionCallback& callback,
|
||||||
const net::BoundNetLog& net_log) {
|
const net::NetLogWithSource& net_log) {
|
||||||
DCHECK(request);
|
DCHECK(request);
|
||||||
request_ = request;
|
request_ = request;
|
||||||
|
|
||||||
|
@ -129,7 +128,8 @@ int DevToolsNetworkTransaction::Start(
|
||||||
request_ = custom_request_.get();
|
request_ = custom_request_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
DevToolsNetworkInterceptor* interceptor = controller_->GetInterceptor(client_id);
|
DevToolsNetworkInterceptor* interceptor =
|
||||||
|
controller_->GetInterceptor(client_id);
|
||||||
if (interceptor) {
|
if (interceptor) {
|
||||||
interceptor_ = interceptor->GetWeakPtr();
|
interceptor_ = interceptor->GetWeakPtr();
|
||||||
if (custom_upload_data_stream_)
|
if (custom_upload_data_stream_)
|
||||||
|
@ -246,10 +246,6 @@ net::LoadState DevToolsNetworkTransaction::GetLoadState() const {
|
||||||
return transaction_->GetLoadState();
|
return transaction_->GetLoadState();
|
||||||
}
|
}
|
||||||
|
|
||||||
net::UploadProgress DevToolsNetworkTransaction::GetUploadProgress() const {
|
|
||||||
return transaction_->GetUploadProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DevToolsNetworkTransaction::SetQuicServerInfo(
|
void DevToolsNetworkTransaction::SetQuicServerInfo(
|
||||||
net::QuicServerInfo* info) {
|
net::QuicServerInfo* info) {
|
||||||
transaction_->SetQuicServerInfo(info);
|
transaction_->SetQuicServerInfo(info);
|
||||||
|
|
|
@ -32,7 +32,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
|
||||||
// HttpTransaction methods:
|
// HttpTransaction methods:
|
||||||
int Start(const net::HttpRequestInfo* request,
|
int Start(const net::HttpRequestInfo* request,
|
||||||
const net::CompletionCallback& callback,
|
const net::CompletionCallback& callback,
|
||||||
const net::BoundNetLog& net_log) override;
|
const net::NetLogWithSource& net_log) override;
|
||||||
int RestartIgnoringLastError(
|
int RestartIgnoringLastError(
|
||||||
const net::CompletionCallback& callback) override;
|
const net::CompletionCallback& callback) override;
|
||||||
int RestartWithCertificate(net::X509Certificate* client_cert,
|
int RestartWithCertificate(net::X509Certificate* client_cert,
|
||||||
|
@ -52,7 +52,6 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
|
||||||
void DoneReading() override;
|
void DoneReading() override;
|
||||||
const net::HttpResponseInfo* GetResponseInfo() const override;
|
const net::HttpResponseInfo* GetResponseInfo() const override;
|
||||||
net::LoadState GetLoadState() const override;
|
net::LoadState GetLoadState() const override;
|
||||||
net::UploadProgress GetUploadProgress() const override;
|
|
||||||
void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override;
|
void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override;
|
||||||
bool GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
|
bool GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
|
||||||
bool GetRemoteEndpoint(net::IPEndPoint* endpoint) const override;
|
bool GetRemoteEndpoint(net::IPEndPoint* endpoint) const override;
|
||||||
|
|
|
@ -35,11 +35,13 @@ bool DevToolsNetworkUploadDataStream::IsInMemory() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DevToolsNetworkUploadDataStream::InitInternal(const net::BoundNetLog& net_log) {
|
int DevToolsNetworkUploadDataStream::InitInternal(
|
||||||
|
const net::NetLogWithSource& net_log) {
|
||||||
throttled_byte_count_ = 0;
|
throttled_byte_count_ = 0;
|
||||||
int result = upload_data_stream_->Init(
|
int result = upload_data_stream_->Init(
|
||||||
base::Bind(&DevToolsNetworkUploadDataStream::StreamInitCallback,
|
base::Bind(&DevToolsNetworkUploadDataStream::StreamInitCallback,
|
||||||
base::Unretained(this)), net_log);
|
base::Unretained(this)),
|
||||||
|
net_log);
|
||||||
if (result == net::OK && !is_chunked())
|
if (result == net::OK && !is_chunked())
|
||||||
SetSize(upload_data_stream_->size());
|
SetSize(upload_data_stream_->size());
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -27,7 +27,7 @@ class DevToolsNetworkUploadDataStream : public net::UploadDataStream {
|
||||||
private:
|
private:
|
||||||
// net::UploadDataStream implementation.
|
// net::UploadDataStream implementation.
|
||||||
bool IsInMemory() const override;
|
bool IsInMemory() const override;
|
||||||
int InitInternal(const net::BoundNetLog& net_log) override;
|
int InitInternal(const net::NetLogWithSource& net_log) override;
|
||||||
int ReadInternal(net::IOBuffer* buf, int buf_len) override;
|
int ReadInternal(net::IOBuffer* buf, int buf_len) override;
|
||||||
void ResetInternal() override;
|
void ResetInternal() override;
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnIOT
|
||||||
|
|
||||||
void PlatformNotificationService::DisplayNotification(
|
void PlatformNotificationService::DisplayNotification(
|
||||||
content::BrowserContext* browser_context,
|
content::BrowserContext* browser_context,
|
||||||
|
const std::string& notification_id,
|
||||||
const GURL& origin,
|
const GURL& origin,
|
||||||
const content::PlatformNotificationData& notification_data,
|
const content::PlatformNotificationData& notification_data,
|
||||||
const content::NotificationResources& notification_resources,
|
const content::NotificationResources& notification_resources,
|
||||||
|
@ -85,8 +86,8 @@ void PlatformNotificationService::DisplayNotification(
|
||||||
|
|
||||||
void PlatformNotificationService::DisplayPersistentNotification(
|
void PlatformNotificationService::DisplayPersistentNotification(
|
||||||
content::BrowserContext* browser_context,
|
content::BrowserContext* browser_context,
|
||||||
int64_t persistent_notification_id,
|
const std::string& notification_id,
|
||||||
const GURL& service_worker_origin,
|
const GURL& service_worker_scope,
|
||||||
const GURL& origin,
|
const GURL& origin,
|
||||||
const content::PlatformNotificationData& notification_data,
|
const content::PlatformNotificationData& notification_data,
|
||||||
const content::NotificationResources& notification_resources) {
|
const content::NotificationResources& notification_resources) {
|
||||||
|
@ -94,7 +95,7 @@ void PlatformNotificationService::DisplayPersistentNotification(
|
||||||
|
|
||||||
void PlatformNotificationService::ClosePersistentNotification(
|
void PlatformNotificationService::ClosePersistentNotification(
|
||||||
content::BrowserContext* browser_context,
|
content::BrowserContext* browser_context,
|
||||||
int64_t persistent_notification_id) {
|
const std::string& notification_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlatformNotificationService::GetDisplayedPersistentNotifications(
|
bool PlatformNotificationService::GetDisplayedPersistentNotifications(
|
||||||
|
|
|
@ -28,7 +28,9 @@ class PlatformNotificationService
|
||||||
content::ResourceContext* resource_context,
|
content::ResourceContext* resource_context,
|
||||||
const GURL& origin,
|
const GURL& origin,
|
||||||
int render_process_id) override;
|
int render_process_id) override;
|
||||||
void DisplayNotification(content::BrowserContext* browser_context,
|
void DisplayNotification(
|
||||||
|
content::BrowserContext* browser_context,
|
||||||
|
const std::string& notification_id,
|
||||||
const GURL& origin,
|
const GURL& origin,
|
||||||
const content::PlatformNotificationData& notification_data,
|
const content::PlatformNotificationData& notification_data,
|
||||||
const content::NotificationResources& notification_resources,
|
const content::NotificationResources& notification_resources,
|
||||||
|
@ -36,14 +38,13 @@ class PlatformNotificationService
|
||||||
base::Closure* cancel_callback) override;
|
base::Closure* cancel_callback) override;
|
||||||
void DisplayPersistentNotification(
|
void DisplayPersistentNotification(
|
||||||
content::BrowserContext* browser_context,
|
content::BrowserContext* browser_context,
|
||||||
int64_t persistent_notification_id,
|
const std::string& notification_id,
|
||||||
const GURL& service_worker_origin,
|
const GURL& service_worker_scope,
|
||||||
const GURL& origin,
|
const GURL& origin,
|
||||||
const content::PlatformNotificationData& notification_data,
|
const content::PlatformNotificationData& notification_data,
|
||||||
const content::NotificationResources& notification_resources) override;
|
const content::NotificationResources& notification_resources) override;
|
||||||
void ClosePersistentNotification(
|
void ClosePersistentNotification(content::BrowserContext* browser_context,
|
||||||
content::BrowserContext* browser_context,
|
const std::string& notification_id) override;
|
||||||
int64_t persistent_notification_id) override;
|
|
||||||
bool GetDisplayedPersistentNotifications(
|
bool GetDisplayedPersistentNotifications(
|
||||||
content::BrowserContext* browser_context,
|
content::BrowserContext* browser_context,
|
||||||
std::set<std::string>* displayed_notifications) override;
|
std::set<std::string>* displayed_notifications) override;
|
||||||
|
|
|
@ -118,8 +118,8 @@ URLRequestContextGetter::URLRequestContextGetter(
|
||||||
NetLog* net_log,
|
NetLog* net_log,
|
||||||
const base::FilePath& base_path,
|
const base::FilePath& base_path,
|
||||||
bool in_memory,
|
bool in_memory,
|
||||||
base::MessageLoop* io_loop,
|
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
||||||
base::MessageLoop* file_loop,
|
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
|
||||||
content::ProtocolHandlerMap* protocol_handlers,
|
content::ProtocolHandlerMap* protocol_handlers,
|
||||||
content::URLRequestInterceptorScopedVector protocol_interceptors)
|
content::URLRequestInterceptorScopedVector protocol_interceptors)
|
||||||
: delegate_(delegate),
|
: delegate_(delegate),
|
||||||
|
@ -127,8 +127,8 @@ URLRequestContextGetter::URLRequestContextGetter(
|
||||||
net_log_(net_log),
|
net_log_(net_log),
|
||||||
base_path_(base_path),
|
base_path_(base_path),
|
||||||
in_memory_(in_memory),
|
in_memory_(in_memory),
|
||||||
io_loop_(io_loop),
|
io_task_runner_(io_task_runner),
|
||||||
file_loop_(file_loop),
|
file_task_runner_(file_task_runner),
|
||||||
protocol_interceptors_(std::move(protocol_interceptors)),
|
protocol_interceptors_(std::move(protocol_interceptors)),
|
||||||
job_factory_(nullptr) {
|
job_factory_(nullptr) {
|
||||||
// Must first be created on the UI thread.
|
// Must first be created on the UI thread.
|
||||||
|
@ -144,7 +144,7 @@ URLRequestContextGetter::URLRequestContextGetter(
|
||||||
// must synchronously run on the glib message loop. This will be passed to
|
// must synchronously run on the glib message loop. This will be passed to
|
||||||
// the URLRequestContextStorage on the IO thread in GetURLRequestContext().
|
// the URLRequestContextStorage on the IO thread in GetURLRequestContext().
|
||||||
proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService(
|
proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService(
|
||||||
io_loop_->task_runner(), file_loop_->task_runner());
|
io_task_runner_, file_task_runner_);
|
||||||
}
|
}
|
||||||
|
|
||||||
URLRequestContextGetter::~URLRequestContextGetter() {
|
URLRequestContextGetter::~URLRequestContextGetter() {
|
||||||
|
|
|
@ -67,8 +67,8 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||||
NetLog* net_log,
|
NetLog* net_log,
|
||||||
const base::FilePath& base_path,
|
const base::FilePath& base_path,
|
||||||
bool in_memory,
|
bool in_memory,
|
||||||
base::MessageLoop* io_loop,
|
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
||||||
base::MessageLoop* file_loop,
|
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
|
||||||
content::ProtocolHandlerMap* protocol_handlers,
|
content::ProtocolHandlerMap* protocol_handlers,
|
||||||
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
||||||
virtual ~URLRequestContextGetter();
|
virtual ~URLRequestContextGetter();
|
||||||
|
@ -90,8 +90,8 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||||
NetLog* net_log_;
|
NetLog* net_log_;
|
||||||
base::FilePath base_path_;
|
base::FilePath base_path_;
|
||||||
bool in_memory_;
|
bool in_memory_;
|
||||||
base::MessageLoop* io_loop_;
|
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
|
||||||
base::MessageLoop* file_loop_;
|
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
|
||||||
|
|
||||||
std::string user_agent_;
|
std::string user_agent_;
|
||||||
|
|
||||||
|
|
|
@ -100,10 +100,6 @@ void ViewsDelegate::OnBeforeWidgetInit(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
base::TimeDelta ViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
|
|
||||||
return base::TimeDelta();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) {
|
bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) {
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
// On Ubuntu Unity, the system always provides a title bar for maximized
|
// On Ubuntu Unity, the system always provides a title bar for maximized
|
||||||
|
|
|
@ -51,7 +51,6 @@ class ViewsDelegate : public views::ViewsDelegate {
|
||||||
void OnBeforeWidgetInit(
|
void OnBeforeWidgetInit(
|
||||||
views::Widget::InitParams* params,
|
views::Widget::InitParams* params,
|
||||||
views::internal::NativeWidgetDelegate* delegate) override;
|
views::internal::NativeWidgetDelegate* delegate) override;
|
||||||
base::TimeDelta GetDefaultTextfieldObscuredRevealDuration() override;
|
|
||||||
bool WindowManagerProvidesTitleBar(bool maximized) override;
|
bool WindowManagerProvidesTitleBar(bool maximized) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -56,7 +56,7 @@ bool NotificationPresenterWin::Init() {
|
||||||
base::string16 NotificationPresenterWin::SaveIconToFilesystem(
|
base::string16 NotificationPresenterWin::SaveIconToFilesystem(
|
||||||
const SkBitmap& icon, const GURL& origin) {
|
const SkBitmap& icon, const GURL& origin) {
|
||||||
std::string filename = base::MD5String(origin.spec()) + ".png";
|
std::string filename = base::MD5String(origin.spec()) + ".png";
|
||||||
base::FilePath path = temp_dir_.path().Append(base::UTF8ToUTF16(filename));
|
base::FilePath path = temp_dir_.GetPath().Append(base::UTF8ToUTF16(filename));
|
||||||
if (base::PathExists(path))
|
if (base::PathExists(path))
|
||||||
return path.value();
|
return path.value();
|
||||||
if (SaveIconToPath(icon, path))
|
if (SaveIconToPath(icon, path))
|
||||||
|
|
2
brightray/vendor/libchromiumcontent
vendored
2
brightray/vendor/libchromiumcontent
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 25ec31e58d23002a02dc85dd4b8200b72d50a6c7
|
Subproject commit e0da1e9caa7c8f3da3519963a9ea32abba43c7c8
|
Loading…
Reference in a new issue