mac: Remove usages of WebContentsView.

This commit is contained in:
Cheng Zhao 2014-07-28 09:34:13 +08:00
parent edbce1c167
commit e52a089ec2
2 changed files with 8 additions and 9 deletions

View file

@ -5,8 +5,6 @@
#include "browser/inspectable_web_contents.h"
#import "browser/mac/bry_inspectable_web_contents_view.h"
#include "content/public/browser/web_contents_view.h"
namespace brightray {
InspectableWebContentsView* CreateInspectableContentsView(InspectableWebContentsImpl* inspectable_web_contents) {

View file

@ -4,7 +4,6 @@
#include "browser/inspectable_web_contents_view_mac.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents_view.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/gfx/mac/scoped_ns_disable_screen_updates.h"
@ -22,7 +21,9 @@ using namespace brightray;
devtools_docked_ = NO;
auto contents = inspectableWebContentsView_->inspectable_web_contents()->GetWebContents();
auto contentsView = contents->GetView()->GetNativeView();
contents->SetAllowOverlappingViews(true);
auto contentsView = contents->GetNativeView();
[contentsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self addSubview:contentsView];
@ -42,7 +43,7 @@ using namespace brightray;
return;
auto devToolsWebContents = inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
auto devToolsView = devToolsWebContents->GetView()->GetNativeView();
auto devToolsView = devToolsWebContents->GetNativeView();
devtools_visible_ = visible;
if (devtools_docked_) {
@ -53,7 +54,7 @@ using namespace brightray;
[self update];
} else {
gfx::ScopedNSDisableScreenUpdates disabler;
devToolsWebContents->GetView()->RemoveOverlayView();
devToolsWebContents->RemoveOverlayView();
[devToolsView removeFromSuperview];
[self adjustSubviews];
}
@ -79,7 +80,7 @@ using namespace brightray;
devtools_docked_ = docked;
if (!docked) {
auto devToolsWebContents = inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
auto devToolsView = devToolsWebContents->GetView()->GetNativeView();
auto devToolsView = devToolsWebContents->GetNativeView();
auto styleMask = NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask |
@ -119,8 +120,8 @@ using namespace brightray;
auto devToolsWebContents = inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
gfx::ScopedNSDisableScreenUpdates disabler;
devToolsWebContents->GetView()->SetOverlayView(
contents->GetView(),
devToolsWebContents->SetOverlayView(
contents,
gfx::Point(strategy_.insets().left(), strategy_.insets().top()));
[self adjustSubviews];
}