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

Side by Side Diff: ash/wm/workspace/frame_maximize_button.cc

Issue 10918077: Adding proper dragging behavior for L/R maximized windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: As requested Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/workspace/frame_maximize_button.h" 5 #include "ash/wm/workspace/frame_maximize_button.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/maximize_bubble_controller.h" 10 #include "ash/wm/maximize_bubble_controller.h"
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 frame_->GetWidget()->GetNativeWindow())) 544 frame_->GetWidget()->GetNativeWindow()))
545 return FRAME_STATE_NONE; 545 return FRAME_STATE_NONE;
546 // The normal maximized test can be used. 546 // The normal maximized test can be used.
547 if (frame_->GetWidget()->IsMaximized()) 547 if (frame_->GetWidget()->IsMaximized())
548 return FRAME_STATE_FULL; 548 return FRAME_STATE_FULL;
549 // For Left/right maximize we need to check the dimensions. 549 // For Left/right maximize we need to check the dimensions.
550 gfx::Rect bounds = frame_->GetWidget()->GetWindowBoundsInScreen(); 550 gfx::Rect bounds = frame_->GetWidget()->GetWindowBoundsInScreen();
551 gfx::Rect screen = gfx::Screen::GetDisplayMatching(bounds).work_area(); 551 gfx::Rect screen = gfx::Screen::GetDisplayMatching(bounds).work_area();
552 if (bounds.width() < (screen.width() * kMinSnapSizePercent) / 100) 552 if (bounds.width() < (screen.width() * kMinSnapSizePercent) / 100)
553 return FRAME_STATE_NONE; 553 return FRAME_STATE_NONE;
554 // We might still have a horizontally filled window at this point which we
555 // treat as no special state.
556 if (bounds.y() != screen.y() || bounds.height() != screen.height())
557 return FRAME_STATE_NONE;
558
554 // We have to be in a maximize mode at this point. 559 // We have to be in a maximize mode at this point.
555 DCHECK(bounds.y() == screen.y());
556 DCHECK(bounds.height() >= screen.height());
557 if (bounds.x() == screen.x()) 560 if (bounds.x() == screen.x())
558 return FRAME_STATE_SNAP_LEFT; 561 return FRAME_STATE_SNAP_LEFT;
559 if (bounds.right() == screen.right()) 562 if (bounds.right() == screen.right())
560 return FRAME_STATE_SNAP_RIGHT; 563 return FRAME_STATE_SNAP_RIGHT;
561 // If we come here, it is likely caused by the fact that the 564 // If we come here, it is likely caused by the fact that the
562 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case 565 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case
563 // we allow all maximize operations (and keep the restore rectangle). 566 // we allow all maximize operations (and keep the restore rectangle).
564 return FRAME_STATE_NONE; 567 return FRAME_STATE_NONE;
565 } 568 }
566 569
567 } // namespace ash 570 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698