Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2212)

Unified Diff: ash/wm/workspace/frame_maximize_button.cc

Issue 10829226: Fixing many problems around the maximize bubble (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed build problem Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/maximize_bubble_controller.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/frame_maximize_button.cc
diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc
index 89297c5d76be29b2e73ba657faa2e1a32055fc1e..e7fc9ead2081972d2c427cd03a51866fd843dd04 100644
--- a/ash/wm/workspace/frame_maximize_button.cc
+++ b/ash/wm/workspace/frame_maximize_button.cc
@@ -113,6 +113,9 @@ FrameMaximizeButton::FrameMaximizeButton(views::ButtonListener* listener,
}
FrameMaximizeButton::~FrameMaximizeButton() {
+ // Before the window gets destroyed, the maximizer dialog needs to be shut
+ // down since it would otherwise call into a deleted object.
+ maximizer_.reset();
if (window_)
OnWindowDestroying(window_);
}
@@ -151,13 +154,12 @@ void FrameMaximizeButton::SnapButtonHovered(SnapType type) {
void FrameMaximizeButton::ExecuteSnapAndCloseMenu(SnapType snap_type) {
DCHECK_NE(snap_type_, SNAP_NONE);
+ Cancel(true);
+ // Tell our menu to close.
+ maximizer_.reset();
snap_type_ = snap_type;
Snap();
- // Remove any pending snap previews.
- SnapButtonHovered(SNAP_NONE);
- // At this point the operation has been performed and the menu should be
- // closed - if not, it'll get now closed.
- maximizer_.reset();
+ // Note: |this| might now be destroyed.
}
void FrameMaximizeButton::DestroyMaximizeMenu() {
@@ -330,9 +332,9 @@ void FrameMaximizeButton::Cancel(bool keep_menu_open) {
maximizer_.reset();
UninstallEventFilter();
is_snap_enabled_ = false;
+ snap_sizer_.reset();
sky 2012/08/08 04:39:17 Persisting the snap_sizer_ makes me nervous. In pa
Mr4D (OOO till 08-26) 2012/08/08 14:26:46 When doing the change I thought the same thing - b
}
phantom_window_.reset();
- snap_sizer_.reset();
snap_type_ = SNAP_NONE;
update_timer_.Stop();
SchedulePaint();
« no previous file with comments | « ash/wm/maximize_bubble_controller.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698