diff options
Diffstat (limited to 'chromium/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc')
-rw-r--r-- | chromium/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/chromium/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/chromium/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 252001f8731..00157394710 100644 --- a/chromium/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/chromium/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc @@ -23,7 +23,6 @@ #include "ui/base/hit_test.h" #include "ui/base/ime/input_method.h" #include "ui/compositor/layer.h" -#include "ui/display/screen.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/point_conversions.h" #include "ui/gfx/geometry/rect.h" @@ -83,6 +82,7 @@ class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver { static aura::Window* CreateParentWindow(aura::Window* child_window, const gfx::Rect& bounds, bool full_screen, + bool is_menu, bool root_is_always_on_top) { // This instance will get deleted when the widget is destroyed. DesktopNativeWidgetTopLevelHandler* top_level_handler = @@ -91,8 +91,9 @@ class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver { child_window->SetBounds(gfx::Rect(bounds.size())); Widget::InitParams init_params; - init_params.type = full_screen ? Widget::InitParams::TYPE_WINDOW : - Widget::InitParams::TYPE_POPUP; + init_params.type = full_screen ? Widget::InitParams::TYPE_WINDOW + : is_menu ? Widget::InitParams::TYPE_MENU + : Widget::InitParams::TYPE_POPUP; init_params.bounds = bounds; init_params.ownership = Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; init_params.layer_type = ui::LAYER_NOT_DRAWN; @@ -198,7 +199,7 @@ class DesktopNativeWidgetAuraWindowParentingClient root_is_always_on_top = native_widget->IsAlwaysOnTop(); return DesktopNativeWidgetTopLevelHandler::CreateParentWindow( - window, bounds, is_fullscreen, root_is_always_on_top); + window, bounds, is_fullscreen, is_menu, root_is_always_on_top); } return root_window_; } @@ -726,11 +727,7 @@ std::string DesktopNativeWidgetAura::GetWorkspace() const { void DesktopNativeWidgetAura::SetBounds(const gfx::Rect& bounds) { if (!content_window_) return; - aura::Window* root = host_->window(); - display::Screen* screen = display::Screen::GetScreen(); - gfx::Rect bounds_in_pixels = screen->DIPToScreenRectInWindow(root, bounds); - desktop_window_tree_host_->AsWindowTreeHost()->SetBoundsInPixels( - bounds_in_pixels); + desktop_window_tree_host_->SetBoundsInDIP(bounds); } void DesktopNativeWidgetAura::SetBoundsConstrained(const gfx::Rect& bounds) { @@ -851,6 +848,9 @@ void DesktopNativeWidgetAura::Maximize() { void DesktopNativeWidgetAura::Minimize() { if (content_window_) desktop_window_tree_host_->Minimize(); + internal::RootView* root_view = + static_cast<internal::RootView*>(GetWidget()->GetRootView()); + root_view->ResetEventHandlers(); } bool DesktopNativeWidgetAura::IsMaximized() const { @@ -1005,10 +1005,6 @@ void DesktopNativeWidgetAura::OnSizeConstraintsChanged() { desktop_window_tree_host_->SizeConstraintsChanged(); } -void DesktopNativeWidgetAura::RepostNativeEvent(gfx::NativeEvent native_event) { - OnEvent(native_event); -} - std::string DesktopNativeWidgetAura::GetName() const { return name_; } @@ -1073,7 +1069,7 @@ bool DesktopNativeWidgetAura::HasHitTestMask() const { return native_widget_delegate_->HasHitTestMask(); } -void DesktopNativeWidgetAura::GetHitTestMask(gfx::Path* mask) const { +void DesktopNativeWidgetAura::GetHitTestMask(SkPath* mask) const { native_widget_delegate_->GetHitTestMask(mask); } |