diff options
-rw-r--r-- | ash/wm/partial_screenshot_view.cc | 17 | ||||
-rw-r--r-- | ash/wm/partial_screenshot_view.h | 3 |
2 files changed, 4 insertions, 16 deletions
diff --git a/ash/wm/partial_screenshot_view.cc b/ash/wm/partial_screenshot_view.cc index 37729a4..8068971 100644 --- a/ash/wm/partial_screenshot_view.cc +++ b/ash/wm/partial_screenshot_view.cc @@ -9,8 +9,6 @@ #include "ash/shell_window_ids.h" #include "ash/wm/partial_screenshot_event_filter.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" -#include "ui/base/events.h" #include "ui/base/cursor/cursor.h" #include "ui/gfx/canvas.h" #include "ui/gfx/rect.h" @@ -22,17 +20,11 @@ namespace ash { PartialScreenshotView::PartialScreenshotView( ScreenshotDelegate* screenshot_delegate) : is_dragging_(false), - screenshot_delegate_(screenshot_delegate), - window_(NULL) { + screenshot_delegate_(screenshot_delegate) { } PartialScreenshotView::~PartialScreenshotView() { screenshot_delegate_ = NULL; - // Do not delete the |window_| here because |window_| has the - // ownership to this object. In case that finishing browser happens - // while |window_| != NULL, |window_| is still removed correctly by - // its parent container. - window_ = NULL; } // static @@ -62,15 +54,14 @@ void PartialScreenshotView::StartPartialScreenshot( // events. This will close the context menu. widget->GetNativeView()->SetCapture(); - view->set_window(widget->GetNativeWindow()); Shell::GetInstance()->partial_screenshot_filter()->Activate(view); } void PartialScreenshotView::Cancel() { - DCHECK(window_); - window_->Hide(); Shell::GetInstance()->partial_screenshot_filter()->Deactivate(); - MessageLoop::current()->DeleteSoon(FROM_HERE, window_); + views::Widget* widget = GetWidget(); + if (widget) + widget->Close(); } gfx::NativeCursor PartialScreenshotView::GetCursor( diff --git a/ash/wm/partial_screenshot_view.h b/ash/wm/partial_screenshot_view.h index 7113146..9d0d0c0 100644 --- a/ash/wm/partial_screenshot_view.h +++ b/ash/wm/partial_screenshot_view.h @@ -34,8 +34,6 @@ class ASH_EXPORT PartialScreenshotView : public views::WidgetDelegateView { private: gfx::Rect GetScreenshotRect() const; - void set_window(aura::Window* window) { window_ = window; } - // Overridden from View: virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void OnMouseCaptureLost() OVERRIDE; @@ -48,7 +46,6 @@ class ASH_EXPORT PartialScreenshotView : public views::WidgetDelegateView { gfx::Point start_position_; gfx::Point current_position_; ScreenshotDelegate* screenshot_delegate_; - aura::Window* window_; DISALLOW_COPY_AND_ASSIGN(PartialScreenshotView); }; |