diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index d5e8ad8514..b0e3784e12 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -395,7 +395,7 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView( views::Widget* widget) { #if defined(USE_X11) LinuxFrameView* frame_view = new LinuxFrameView; -#else defined(OS_WIN) +#else WinFrameView* frame_view = new WinFrameView; #endif frame_view->Init(this, widget); diff --git a/atom/browser/ui/views/frameless_view.cc b/atom/browser/ui/views/frameless_view.cc index 7a98891dca..a7c5f3c176 100644 --- a/atom/browser/ui/views/frameless_view.cc +++ b/atom/browser/ui/views/frameless_view.cc @@ -6,6 +6,7 @@ #include "atom/browser/native_window_views.h" #include "ui/aura/window.h" +#include "ui/base/hit_test.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" diff --git a/atom/browser/ui/views/linux_frame_view.cc b/atom/browser/ui/views/linux_frame_view.cc index b8c9265f12..c68a2e9332 100644 --- a/atom/browser/ui/views/linux_frame_view.cc +++ b/atom/browser/ui/views/linux_frame_view.cc @@ -76,9 +76,7 @@ const gfx::FontList& GetTitleFontList() { // LinuxFrameView, public: LinuxFrameView::LinuxFrameView() - : window_(NULL), - frame_(NULL), - window_icon_(NULL), + : window_icon_(NULL), minimize_button_(NULL), maximize_button_(NULL), restore_button_(NULL), @@ -117,12 +115,6 @@ void LinuxFrameView::Init(NativeWindowViews* window, views::Widget* frame) { } } -int LinuxFrameView::ResizingBorderHitTest(const gfx::Point& point) { - return GetHTComponentForFrame(point, FrameBorderThickness(), - FrameBorderThickness() + kClientEdgeThickness, kResizeAreaCornerSize, - kResizeAreaCornerSize, true); -} - /////////////////////////////////////////////////////////////////////////////// // LinuxFrameView, NonClientFrameView implementation: @@ -141,23 +133,13 @@ gfx::Rect LinuxFrameView::GetWindowBoundsForClientBounds( } int LinuxFrameView::NonClientHitTest(const gfx::Point& point) { + if (!window_->has_frame()) + return FramelessView::NonClientHitTest(point); + // Sanity check. if (!bounds().Contains(point)) return HTNOWHERE; - // Check for possible draggable region in the client area for the frameless - // window. - SkRegion* draggable_region = window_->draggable_region(); - if (draggable_region && draggable_region->contains(point.x(), point.y())) - return HTCAPTION; - - // Support resizing frameless window by dragging the border. - if (!window_->has_frame() && frame_->widget_delegate()->CanResize()) { - int window_component = ResizingBorderHitTest(point); - if (window_component != HTNOWHERE) - return window_component; - } - int frame_component = frame_->client_view()->NonClientHitTest(point); // See if we're in the sysmenu region. (We check the ClientView first to be diff --git a/atom/browser/ui/views/linux_frame_view.h b/atom/browser/ui/views/linux_frame_view.h index 85ea975e3c..2f6793fe7a 100644 --- a/atom/browser/ui/views/linux_frame_view.h +++ b/atom/browser/ui/views/linux_frame_view.h @@ -21,7 +21,7 @@ class ImageButton; namespace atom { -class LinuxFrameView : public FramelessView +class LinuxFrameView : public FramelessView, public views::ButtonListener { public: LinuxFrameView(); @@ -51,9 +51,6 @@ class LinuxFrameView : public FramelessView virtual void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE; - // Returns whether the |point| is on frameless window's resizing border. - int ResizingBorderHitTest(const gfx::Point& point); - private: // Returns the thickness of the border that makes up the window frame edges. // This does not include any client edge.