commit
c67ba6de6a
18 changed files with 74 additions and 209 deletions
|
@ -62,6 +62,14 @@
|
|||
'NDEBUG',
|
||||
'USING_V8_SHARED',
|
||||
'WEBKIT_DLL',
|
||||
# From skia_for_chromium_defines.gypi:
|
||||
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
|
||||
'SK_SUPPORT_LEGACY_BITMAP_CONFIG',
|
||||
'SK_SUPPORT_LEGACY_DEVICE_VIRTUAL_ISOPAQUE',
|
||||
'SK_SUPPORT_LEGACY_N32_NAME',
|
||||
'SK_SUPPORT_LEGACY_SETCONFIG',
|
||||
'SK_IGNORE_ETC1_SUPPORT',
|
||||
'SK_IGNORE_GPU_DITHER',
|
||||
],
|
||||
'msvs_configuration_attributes': {
|
||||
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
|
||||
|
|
|
@ -61,7 +61,7 @@ content::BrowserMainParts* BrowserClient::CreateBrowserMainParts(
|
|||
net::URLRequestContextGetter* BrowserClient::CreateRequestContext(
|
||||
content::BrowserContext* browser_context,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors) {
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors) {
|
||||
auto context = static_cast<BrowserContext*>(browser_context);
|
||||
return context->CreateRequestContext(protocol_handlers, protocol_interceptors.Pass());
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class BrowserClient : public content::ContentBrowserClient {
|
|||
virtual net::URLRequestContextGetter* CreateRequestContext(
|
||||
content::BrowserContext* browser_context,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE;
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors) OVERRIDE;
|
||||
|
||||
private:
|
||||
virtual content::BrowserMainParts* CreateBrowserMainParts(
|
||||
|
|
|
@ -101,7 +101,7 @@ void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) {
|
|||
|
||||
net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors) {
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors) {
|
||||
DCHECK(!url_request_getter_);
|
||||
url_request_getter_ = new URLRequestContextGetter(
|
||||
this,
|
||||
|
@ -118,12 +118,6 @@ net::NetworkDelegate* BrowserContext::CreateNetworkDelegate() {
|
|||
return new NetworkDelegate;
|
||||
}
|
||||
|
||||
net::URLRequestJobFactory* BrowserContext::CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
base::FilePath BrowserContext::GetPath() const {
|
||||
return path_;
|
||||
}
|
||||
|
@ -158,36 +152,6 @@ net::URLRequestContextGetter*
|
|||
return GetRequestContext();
|
||||
}
|
||||
|
||||
void BrowserContext::RequestMidiSysExPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame,
|
||||
bool user_gesture,
|
||||
const MidiSysExPermissionCallback& callback) {
|
||||
callback.Run(false);
|
||||
}
|
||||
|
||||
void BrowserContext::CancelMidiSysExPermissionRequest(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame) {
|
||||
}
|
||||
|
||||
void BrowserContext::RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) {
|
||||
callback.Run(false);
|
||||
}
|
||||
|
||||
void BrowserContext::CancelProtectedMediaIdentifierPermissionRequests(int group_id) {
|
||||
}
|
||||
|
||||
content::ResourceContext* BrowserContext::GetResourceContext() {
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
@ -198,17 +162,16 @@ content::DownloadManagerDelegate* BrowserContext::GetDownloadManagerDelegate() {
|
|||
return download_manager_delegate_.get();
|
||||
}
|
||||
|
||||
content::GeolocationPermissionContext*
|
||||
BrowserContext::GetGeolocationPermissionContext() {
|
||||
return nullptr;
|
||||
content::BrowserPluginGuestManager* BrowserContext::GetGuestManager() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
quota::SpecialStoragePolicy* BrowserContext::GetSpecialStoragePolicy() {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content::BrowserPluginGuestManagerDelegate* BrowserContext::GetGuestManagerDelegate() {
|
||||
return nullptr;
|
||||
content::PushMessagingService* BrowserContext::GetPushMessagingService() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
|
|
@ -26,7 +26,7 @@ class BrowserContext : public content::BrowserContext,
|
|||
|
||||
net::URLRequestContextGetter* CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors);
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
||||
|
||||
net::URLRequestContextGetter* url_request_context_getter() const {
|
||||
return url_request_getter_.get();
|
||||
|
@ -40,9 +40,6 @@ class BrowserContext : public content::BrowserContext,
|
|||
|
||||
// URLRequestContextGetter::Delegate:
|
||||
virtual net::NetworkDelegate* CreateNetworkDelegate() OVERRIDE;
|
||||
virtual net::URLRequestJobFactory* CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors) OVERRIDE;
|
||||
|
||||
virtual base::FilePath GetPath() const OVERRIDE;
|
||||
|
||||
|
@ -61,35 +58,11 @@ class BrowserContext : public content::BrowserContext,
|
|||
virtual net::URLRequestContextGetter*
|
||||
GetMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path, bool in_memory);
|
||||
virtual void RequestMidiSysExPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame,
|
||||
bool user_gesture,
|
||||
const MidiSysExPermissionCallback& callback) OVERRIDE;
|
||||
virtual void CancelMidiSysExPermissionRequest(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame) OVERRIDE;
|
||||
virtual void RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) OVERRIDE;
|
||||
virtual void CancelProtectedMediaIdentifierPermissionRequests(int group_id) OVERRIDE;
|
||||
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
|
||||
virtual content::DownloadManagerDelegate*
|
||||
GetDownloadManagerDelegate() OVERRIDE;
|
||||
virtual content::GeolocationPermissionContext*
|
||||
GetGeolocationPermissionContext() OVERRIDE;
|
||||
virtual content::BrowserPluginGuestManagerDelegate*
|
||||
GetGuestManagerDelegate() OVERRIDE;
|
||||
virtual quota::SpecialStoragePolicy*
|
||||
GetSpecialStoragePolicy() OVERRIDE;
|
||||
virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE;
|
||||
virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE;
|
||||
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
|
||||
virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE;
|
||||
|
||||
base::FilePath path_;
|
||||
scoped_ptr<ResourceContext> resource_context_;
|
||||
|
|
|
@ -6,80 +6,48 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
DevToolsContentsResizingStrategy::DevToolsContentsResizingStrategy() {
|
||||
}
|
||||
|
||||
DevToolsContentsResizingStrategy::DevToolsContentsResizingStrategy(
|
||||
const gfx::Insets& insets, const gfx::Size& min_size)
|
||||
: insets_(insets),
|
||||
min_size_(min_size) {
|
||||
DevToolsContentsResizingStrategy::DevToolsContentsResizingStrategy()
|
||||
: hide_inspected_contents_(false) {
|
||||
}
|
||||
|
||||
DevToolsContentsResizingStrategy::DevToolsContentsResizingStrategy(
|
||||
const gfx::Rect& bounds)
|
||||
: bounds_(bounds) {
|
||||
: bounds_(bounds),
|
||||
hide_inspected_contents_(bounds_.IsEmpty() && !bounds_.x() &&
|
||||
!bounds_.y()) {
|
||||
}
|
||||
|
||||
|
||||
void DevToolsContentsResizingStrategy::CopyFrom(
|
||||
const DevToolsContentsResizingStrategy& strategy) {
|
||||
insets_ = strategy.insets();
|
||||
min_size_ = strategy.min_size();
|
||||
bounds_ = strategy.bounds();
|
||||
hide_inspected_contents_ = strategy.hide_inspected_contents();
|
||||
}
|
||||
|
||||
bool DevToolsContentsResizingStrategy::Equals(
|
||||
const DevToolsContentsResizingStrategy& strategy) {
|
||||
return insets_ == strategy.insets() && min_size_ == strategy.min_size() &&
|
||||
bounds_ == strategy.bounds();
|
||||
return bounds_ == strategy.bounds() &&
|
||||
hide_inspected_contents_ == strategy.hide_inspected_contents();
|
||||
}
|
||||
|
||||
void ApplyDevToolsContentsResizingStrategy(
|
||||
const DevToolsContentsResizingStrategy& strategy,
|
||||
const gfx::Size& container_size,
|
||||
const gfx::Rect& old_devtools_bounds,
|
||||
const gfx::Rect& old_contents_bounds,
|
||||
gfx::Rect* new_devtools_bounds,
|
||||
gfx::Rect* new_contents_bounds) {
|
||||
new_devtools_bounds->SetRect(
|
||||
0, 0, container_size.width(), container_size.height());
|
||||
|
||||
const gfx::Insets& insets = strategy.insets();
|
||||
const gfx::Size& min_size = strategy.min_size();
|
||||
const gfx::Rect& bounds = strategy.bounds();
|
||||
|
||||
if (!bounds.size().IsEmpty()) {
|
||||
int left = std::min(bounds.x(), container_size.width());
|
||||
int top = std::min(bounds.y(), container_size.height());
|
||||
int width = std::min(bounds.width(), container_size.width() - left);
|
||||
int height = std::min(bounds.height(), container_size.height() - top);
|
||||
new_contents_bounds->SetRect(left, top, width, height);
|
||||
if (bounds.size().IsEmpty() && !strategy.hide_inspected_contents()) {
|
||||
new_contents_bounds->SetRect(
|
||||
0, 0, container_size.width(), container_size.height());
|
||||
return;
|
||||
}
|
||||
|
||||
int width = std::max(0, container_size.width() - insets.width());
|
||||
int left = insets.left();
|
||||
if (width < min_size.width() && insets.width() > 0) {
|
||||
int min_width = std::min(min_size.width(), container_size.width());
|
||||
int insets_width = container_size.width() - min_width;
|
||||
int insets_decrease = insets.width() - insets_width;
|
||||
// Decrease both left and right insets proportionally.
|
||||
left -= insets_decrease * insets.left() / insets.width();
|
||||
width = min_width;
|
||||
}
|
||||
left = std::max(0, std::min(container_size.width(), left));
|
||||
|
||||
int height = std::max(0, container_size.height() - insets.height());
|
||||
int top = insets.top();
|
||||
if (height < min_size.height() && insets.height() > 0) {
|
||||
int min_height = std::min(min_size.height(), container_size.height());
|
||||
int insets_height = container_size.height() - min_height;
|
||||
int insets_decrease = insets.height() - insets_height;
|
||||
// Decrease both top and bottom insets proportionally.
|
||||
top -= insets_decrease * insets.top() / insets.height();
|
||||
height = min_height;
|
||||
}
|
||||
top = std::max(0, std::min(container_size.height(), top));
|
||||
|
||||
int left = std::min(bounds.x(), container_size.width());
|
||||
int top = std::min(bounds.y(), container_size.height());
|
||||
int width = std::min(bounds.width(), container_size.width() - left);
|
||||
int height = std::min(bounds.height(), container_size.height() - top);
|
||||
new_contents_bounds->SetRect(left, top, width, height);
|
||||
}
|
||||
|
|
|
@ -15,28 +15,22 @@
|
|||
class DevToolsContentsResizingStrategy {
|
||||
public:
|
||||
DevToolsContentsResizingStrategy();
|
||||
DevToolsContentsResizingStrategy(
|
||||
const gfx::Insets& insets,
|
||||
const gfx::Size& min_size);
|
||||
explicit DevToolsContentsResizingStrategy(const gfx::Rect& bounds);
|
||||
explicit DevToolsContentsResizingStrategy(
|
||||
const gfx::Rect& bounds);
|
||||
|
||||
void CopyFrom(const DevToolsContentsResizingStrategy& strategy);
|
||||
bool Equals(const DevToolsContentsResizingStrategy& strategy);
|
||||
|
||||
const gfx::Insets& insets() const { return insets_; }
|
||||
const gfx::Size& min_size() const { return min_size_; }
|
||||
const gfx::Rect& bounds() const { return bounds_; }
|
||||
bool hide_inspected_contents() const { return hide_inspected_contents_; }
|
||||
|
||||
private:
|
||||
// Insets of contents inside DevTools.
|
||||
gfx::Insets insets_;
|
||||
|
||||
// Minimum size of contents.
|
||||
gfx::Size min_size_;
|
||||
|
||||
// Contents bounds. When non-empty, used instead of insets.
|
||||
gfx::Rect bounds_;
|
||||
|
||||
// Determines whether inspected contents is visible.
|
||||
bool hide_inspected_contents_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DevToolsContentsResizingStrategy);
|
||||
};
|
||||
|
||||
|
@ -48,8 +42,6 @@ class DevToolsContentsResizingStrategy {
|
|||
void ApplyDevToolsContentsResizingStrategy(
|
||||
const DevToolsContentsResizingStrategy& strategy,
|
||||
const gfx::Size& container_size,
|
||||
const gfx::Rect& old_devtools_bounds,
|
||||
const gfx::Rect& old_contents_bounds,
|
||||
gfx::Rect* new_devtools_bounds,
|
||||
gfx::Rect* new_contents_bounds);
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ class Target : public content::DevToolsTarget {
|
|||
explicit Target(WebContents* web_contents);
|
||||
|
||||
virtual std::string GetId() const OVERRIDE { return id_; }
|
||||
virtual std::string GetParentId() const { return std::string(); }
|
||||
virtual std::string GetType() const OVERRIDE { return kTargetTypePage; }
|
||||
virtual std::string GetTitle() const OVERRIDE { return title_; }
|
||||
virtual std::string GetDescription() const OVERRIDE { return std::string(); }
|
||||
|
@ -134,8 +135,8 @@ DevToolsDelegate::DevToolsDelegate(
|
|||
content::BrowserContext* browser_context)
|
||||
: browser_context_(browser_context) {
|
||||
std::string frontend_url;
|
||||
devtools_http_handler_ =
|
||||
DevToolsHttpHandler::Start(CreateSocketFactory(), frontend_url, this);
|
||||
devtools_http_handler_ = DevToolsHttpHandler::Start(
|
||||
CreateSocketFactory(), frontend_url, this, base::FilePath());
|
||||
}
|
||||
|
||||
DevToolsDelegate::~DevToolsDelegate() {
|
||||
|
|
|
@ -23,33 +23,20 @@ bool GetValue(const base::ListValue& list, int pos, bool& value) {
|
|||
return list.GetBoolean(pos, &value);
|
||||
}
|
||||
|
||||
bool GetValue(const base::ListValue& list, int pos, gfx::Insets& insets) {
|
||||
const base::DictionaryValue* dict;
|
||||
if (!list.GetDictionary(pos, &dict))
|
||||
return false;
|
||||
int top = 0;
|
||||
int left = 0;
|
||||
int bottom = 0;
|
||||
int right = 0;
|
||||
if (!dict->GetInteger("top", &top) ||
|
||||
!dict->GetInteger("left", &left) ||
|
||||
!dict->GetInteger("bottom", &bottom) ||
|
||||
!dict->GetInteger("right", &right))
|
||||
return false;
|
||||
insets.Set(top, left, bottom, right);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetValue(const base::ListValue& list, int pos, gfx::Size& size) {
|
||||
bool GetValue(const base::ListValue& list, int pos, gfx::Rect& rect) {
|
||||
const base::DictionaryValue* dict;
|
||||
if (!list.GetDictionary(pos, &dict))
|
||||
return false;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
if (!dict->GetInteger("width", &width) ||
|
||||
if (!dict->GetInteger("x", &x) ||
|
||||
!dict->GetInteger("y", &y) ||
|
||||
!dict->GetInteger("width", &width) ||
|
||||
!dict->GetInteger("height", &height))
|
||||
return false;
|
||||
size.SetSize(width, height);
|
||||
rect.SetRect(x, y, width, height);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -191,8 +178,8 @@ DevToolsEmbedderMessageDispatcher::DevToolsEmbedderMessageDispatcher(
|
|||
RegisterHandler("closeWindow",
|
||||
BindToListParser(base::Bind(&Delegate::CloseWindow,
|
||||
base::Unretained(delegate))));
|
||||
RegisterHandler("setContentsResizingStrategy",
|
||||
BindToListParser(base::Bind(&Delegate::SetContentsResizingStrategy,
|
||||
RegisterHandler("setInspectedPageBounds",
|
||||
BindToListParser(base::Bind(&Delegate::SetInspectedPageBounds,
|
||||
base::Unretained(delegate))));
|
||||
RegisterHandler("inspectElementCompleted",
|
||||
BindToListParser(base::Bind(&Delegate::InspectElementCompleted,
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "base/callback.h"
|
||||
#include "ui/gfx/insets.h"
|
||||
#include "ui/gfx/rect.h"
|
||||
#include "ui/gfx/size.h"
|
||||
|
||||
namespace base {
|
||||
|
@ -32,8 +33,7 @@ class DevToolsEmbedderMessageDispatcher {
|
|||
|
||||
virtual void ActivateWindow() = 0;
|
||||
virtual void CloseWindow() = 0;
|
||||
virtual void SetContentsResizingStrategy(
|
||||
const gfx::Insets& insets, const gfx::Size& min_size) = 0;
|
||||
virtual void SetInspectedPageBounds(const gfx::Rect& rect) = 0;
|
||||
virtual void InspectElementCompleted() = 0;
|
||||
virtual void MoveWindow(int x, int y) = 0;
|
||||
virtual void SetIsDocked(bool docked) = 0;
|
||||
|
|
|
@ -156,8 +156,7 @@ void InspectableWebContentsImpl::ShowDevTools() {
|
|||
embedder_message_dispatcher_.reset(
|
||||
new DevToolsEmbedderMessageDispatcher(this));
|
||||
|
||||
auto create_params = content::WebContents::CreateParams(
|
||||
web_contents_->GetBrowserContext());
|
||||
content::WebContents::CreateParams create_params(web_contents_->GetBrowserContext());
|
||||
devtools_web_contents_.reset(content::WebContents::Create(create_params));
|
||||
|
||||
Observe(devtools_web_contents_.get());
|
||||
|
@ -213,9 +212,8 @@ void InspectableWebContentsImpl::CloseWindow() {
|
|||
devtools_web_contents()->DispatchBeforeUnload(false);
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::SetContentsResizingStrategy(
|
||||
const gfx::Insets& insets, const gfx::Size& min_size) {
|
||||
DevToolsContentsResizingStrategy strategy(insets, min_size);
|
||||
void InspectableWebContentsImpl::SetInspectedPageBounds(const gfx::Rect& rect) {
|
||||
DevToolsContentsResizingStrategy strategy(rect);
|
||||
if (contents_resizing_strategy_.Equals(strategy))
|
||||
return;
|
||||
|
||||
|
|
|
@ -64,8 +64,7 @@ class InspectableWebContentsImpl :
|
|||
|
||||
virtual void ActivateWindow() OVERRIDE;
|
||||
virtual void CloseWindow() OVERRIDE;
|
||||
virtual void SetContentsResizingStrategy(
|
||||
const gfx::Insets& insets, const gfx::Size& min_size) OVERRIDE;
|
||||
virtual void SetInspectedPageBounds(const gfx::Rect& rect) OVERRIDE;
|
||||
virtual void InspectElementCompleted() OVERRIDE;
|
||||
virtual void MoveWindow(int x, int y) OVERRIDE;
|
||||
virtual void SetIsDocked(bool docked) OVERRIDE;
|
||||
|
|
|
@ -28,7 +28,4 @@ using brightray::InspectableWebContentsViewMac;
|
|||
- (void)setIsDocked:(BOOL)docked;
|
||||
- (void)setContentsResizingStrategy:(const DevToolsContentsResizingStrategy&)strategy;
|
||||
|
||||
// Adjust docked devtools to the contents resizing strategy.
|
||||
- (void)update;
|
||||
|
||||
@end
|
||||
|
|
|
@ -54,13 +54,12 @@ using namespace brightray;
|
|||
// Place the devToolsView under contentsView, notice that we didn't set
|
||||
// sizes for them until the setContentsResizingStrategy message.
|
||||
[self addSubview:devToolsView positioned:NSWindowBelow relativeTo:nil];
|
||||
[self update];
|
||||
[self adjustSubviews];
|
||||
|
||||
// Focus on web view.
|
||||
devToolsWebContents->RestoreFocus();
|
||||
} else {
|
||||
gfx::ScopedNSDisableScreenUpdates disabler;
|
||||
devToolsWebContents->RemoveOverlayView();
|
||||
[devToolsView removeFromSuperview];
|
||||
[self adjustSubviews];
|
||||
}
|
||||
|
@ -115,20 +114,6 @@ using namespace brightray;
|
|||
|
||||
- (void)setContentsResizingStrategy:(const DevToolsContentsResizingStrategy&)strategy {
|
||||
strategy_.CopyFrom(strategy);
|
||||
[self update];
|
||||
}
|
||||
|
||||
- (void)update {
|
||||
if (!devtools_docked_)
|
||||
return;
|
||||
|
||||
auto contents = inspectableWebContentsView_->inspectable_web_contents()->GetWebContents();
|
||||
auto devToolsWebContents = inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
|
||||
|
||||
gfx::ScopedNSDisableScreenUpdates disabler;
|
||||
devToolsWebContents->SetOverlayView(
|
||||
contents,
|
||||
gfx::Point(strategy_.insets().left(), strategy_.insets().top()));
|
||||
[self adjustSubviews];
|
||||
}
|
||||
|
||||
|
@ -152,8 +137,6 @@ using namespace brightray;
|
|||
gfx::Rect new_contents_bounds;
|
||||
ApplyDevToolsContentsResizingStrategy(
|
||||
strategy_, gfx::Size(NSSizeToCGSize([self bounds].size)),
|
||||
[self flipNSRectToRect:[devToolsView bounds]],
|
||||
[self flipNSRectToRect:[contentsView bounds]],
|
||||
&new_devtools_bounds, &new_contents_bounds);
|
||||
[devToolsView setFrame:[self flipRectToNSRect:new_devtools_bounds]];
|
||||
[contentsView setFrame:[self flipRectToNSRect:new_contents_bounds]];
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/cookie_store_factory.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
#include "net/base/host_mapping_rules.h"
|
||||
#include "net/cert/cert_verifier.h"
|
||||
#include "net/cookies/cookie_monster.h"
|
||||
|
@ -33,11 +32,12 @@
|
|||
#include "net/ssl/ssl_config_service_defaults.h"
|
||||
#include "net/url_request/data_protocol_handler.h"
|
||||
#include "net/url_request/file_protocol_handler.h"
|
||||
#include "net/url_request/protocol_intercept_job_factory.h"
|
||||
#include "net/url_request/static_http_user_agent_settings.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
#include "net/url_request/url_request_context_storage.h"
|
||||
#include "net/url_request/url_request_intercepting_job_factory.h"
|
||||
#include "net/url_request/url_request_job_factory_impl.h"
|
||||
#include "url/url_constants.h"
|
||||
#include "webkit/browser/quota/special_storage_policy.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
|
@ -75,24 +75,24 @@ const char kProxyServer[] = "proxy-server";
|
|||
|
||||
net::URLRequestJobFactory* URLRequestContextGetter::Delegate::CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors) {
|
||||
content::URLRequestInterceptorScopedVector* protocol_interceptors) {
|
||||
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(new net::URLRequestJobFactoryImpl);
|
||||
|
||||
for (auto it = protocol_handlers->begin(); it != protocol_handlers->end(); ++it)
|
||||
job_factory->SetProtocolHandler(it->first, it->second.release());
|
||||
protocol_handlers->clear();
|
||||
|
||||
job_factory->SetProtocolHandler(content::kDataScheme, new net::DataProtocolHandler);
|
||||
job_factory->SetProtocolHandler(content::kFileScheme, new net::FileProtocolHandler(
|
||||
job_factory->SetProtocolHandler(url::kDataScheme, new net::DataProtocolHandler);
|
||||
job_factory->SetProtocolHandler(url::kFileScheme, new net::FileProtocolHandler(
|
||||
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
|
||||
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
|
||||
|
||||
// Set up interceptors in the reverse order.
|
||||
scoped_ptr<net::URLRequestJobFactory> top_job_factory =
|
||||
job_factory.PassAs<net::URLRequestJobFactory>();
|
||||
for (content::ProtocolHandlerScopedVector::reverse_iterator i = protocol_interceptors->rbegin();
|
||||
i != protocol_interceptors->rend(); ++i)
|
||||
top_job_factory.reset(new net::ProtocolInterceptJobFactory(
|
||||
content::URLRequestInterceptorScopedVector::reverse_iterator i;
|
||||
for (i = protocol_interceptors->rbegin(); i != protocol_interceptors->rend(); ++i)
|
||||
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
|
||||
top_job_factory.Pass(), make_scoped_ptr(*i)));
|
||||
protocol_interceptors->weak_clear();
|
||||
|
||||
|
@ -105,7 +105,7 @@ URLRequestContextGetter::URLRequestContextGetter(
|
|||
base::MessageLoop* io_loop,
|
||||
base::MessageLoop* file_loop,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors)
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors)
|
||||
: delegate_(delegate),
|
||||
base_path_(base_path),
|
||||
io_loop_(io_loop),
|
||||
|
|
|
@ -35,7 +35,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
virtual net::NetworkDelegate* CreateNetworkDelegate() { return NULL; }
|
||||
virtual net::URLRequestJobFactory* CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors);
|
||||
content::URLRequestInterceptorScopedVector* protocol_interceptors);
|
||||
};
|
||||
|
||||
URLRequestContextGetter(
|
||||
|
@ -44,7 +44,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
base::MessageLoop* io_loop,
|
||||
base::MessageLoop* file_loop,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors);
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
||||
virtual ~URLRequestContextGetter();
|
||||
|
||||
// net::URLRequestContextGetter:
|
||||
|
@ -66,7 +66,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
scoped_ptr<net::URLRequestContext> url_request_context_;
|
||||
scoped_ptr<net::HostMappingRules> host_mapping_rules_;
|
||||
content::ProtocolHandlerMap protocol_handlers_;
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors_;
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
|
||||
};
|
||||
|
|
|
@ -138,7 +138,6 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked) {
|
|||
params.delegate = new DevToolsWindowDelegate(this,
|
||||
devtools_window_web_view_,
|
||||
devtools_window_.get());
|
||||
params.top_level = true;
|
||||
params.bounds = inspectable_web_contents()->GetDevToolsBounds();
|
||||
#if defined(USE_X11)
|
||||
// In X11 the window frame is drawn by the application.
|
||||
|
@ -163,12 +162,9 @@ void InspectableWebContentsViewViews::Layout() {
|
|||
}
|
||||
|
||||
gfx::Size container_size(width(), height());
|
||||
gfx::Rect old_devtools_bounds(devtools_web_view_->bounds());
|
||||
gfx::Rect old_contents_bounds(contents_web_view_->bounds());
|
||||
gfx::Rect new_devtools_bounds;
|
||||
gfx::Rect new_contents_bounds;
|
||||
ApplyDevToolsContentsResizingStrategy(strategy_, container_size,
|
||||
old_devtools_bounds, old_contents_bounds,
|
||||
&new_devtools_bounds, &new_contents_bounds);
|
||||
|
||||
// DevTools cares about the specific position, so we have to compensate RTL
|
||||
|
|
2
brightray/vendor/libchromiumcontent
vendored
2
brightray/vendor/libchromiumcontent
vendored
|
@ -1 +1 @@
|
|||
Subproject commit a88222442d2a85345d9a208c23456956c208571d
|
||||
Subproject commit 887f3b7895c55625d20d7ea06fa041dcacdb8b47
|
Loading…
Reference in a new issue