| Index: ui/views/widget/native_widget_aura.cc
|
| diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
|
| index 4220b3a043854064d02a07f3ab87928b25502cec..a661c4a94478df13fe7dfce995346afbaa8b0d52 100644
|
| --- a/ui/views/widget/native_widget_aura.cc
|
| +++ b/ui/views/widget/native_widget_aura.cc
|
| @@ -60,11 +60,12 @@ void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) {
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // NativeWidgetAura, public:
|
|
|
| -NativeWidgetAura::NativeWidgetAura(internal::NativeWidgetDelegate* delegate)
|
| +NativeWidgetAura::NativeWidgetAura(
|
| + internal::NativeWidgetDelegate* delegate, gfx::NativeView parent)
|
| : delegate_(delegate),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(desktop_helper_(
|
| ViewsDelegate::views_delegate ?
|
| - ViewsDelegate::views_delegate->CreateNativeWidgetHelper(this) :
|
| + ViewsDelegate::views_delegate->CreateNativeWidgetHelper(this, parent):
|
| NULL)),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))),
|
| ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET),
|
| @@ -136,7 +137,8 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
|
| // If a parent is specified but no bounds are given,
|
| // use the origin of the parent's display so that the widget
|
| // will be added to the same display as the parent.
|
| - gfx::Rect bounds = gfx::Screen::GetDisplayNearestWindow(parent).bounds();
|
| + gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)->
|
| + GetDisplayNearestWindow(parent).bounds();
|
| window_bounds.set_origin(bounds.origin());
|
| }
|
| window_->SetParent(parent);
|
| @@ -284,8 +286,8 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
|
| // When centering window, we take the intersection of the host and
|
| // the parent. We assume the root window represents the visible
|
| // rect of a single screen.
|
| - gfx::Rect work_area =
|
| - gfx::Screen::GetDisplayNearestWindow(window_).work_area();
|
| + gfx::Rect work_area = gfx::Screen::GetScreenFor(window_)->
|
| + GetDisplayNearestWindow(window_).work_area();
|
|
|
| aura::client::ScreenPositionClient* screen_position_client =
|
| aura::client::GetScreenPositionClient(window_->GetRootWindow());
|
| @@ -392,7 +394,8 @@ void NativeWidgetAura::SetBounds(const gfx::Rect& bounds) {
|
| aura::client::ScreenPositionClient* screen_position_client =
|
| aura::client::GetScreenPositionClient(root);
|
| if (screen_position_client) {
|
| - gfx::Display dst_display = gfx::Screen::GetDisplayMatching(bounds);
|
| + gfx::Display dst_display =
|
| + gfx::Screen::GetScreenFor(window_)->GetDisplayMatching(bounds);
|
| screen_position_client->SetBounds(window_, bounds, dst_display);
|
| return;
|
| }
|
| @@ -591,7 +594,8 @@ void NativeWidgetAura::ClearNativeFocus() {
|
| }
|
|
|
| gfx::Rect NativeWidgetAura::GetWorkAreaBoundsInScreen() const {
|
| - return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area();
|
| + return gfx::Screen::GetScreenFor(GetNativeView())->
|
| + GetDisplayNearestWindow(GetNativeView()).work_area();
|
| }
|
|
|
| void NativeWidgetAura::SetInactiveRenderingDisabled(bool value) {
|
| @@ -915,8 +919,9 @@ namespace internal {
|
|
|
| // static
|
| NativeWidgetPrivate* NativeWidgetPrivate::CreateNativeWidget(
|
| - internal::NativeWidgetDelegate* delegate) {
|
| - return new NativeWidgetAura(delegate);
|
| + internal::NativeWidgetDelegate* delegate,
|
| + gfx::NativeView parent) {
|
| + return new NativeWidgetAura(delegate, parent);
|
| }
|
|
|
| // static
|
|
|