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

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

Issue 10883069: Added restore functionality for maximize full/left/right (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: ash/wm/workspace/workspace_event_filter.cc
diff --git a/ash/wm/workspace/workspace_event_filter.cc b/ash/wm/workspace/workspace_event_filter.cc
index 0865beb3ac71fc97019414a507e0f8c7cfcdd841..6c9538b4dc7c32a23b4e773cd7653287febab896 100644
--- a/ash/wm/workspace/workspace_event_filter.cc
+++ b/ash/wm/workspace/workspace_event_filter.cc
@@ -37,11 +37,17 @@ void SingleAxisUnmaximize(aura::Window* window,
window->ClearProperty(aura::client::kRestoreBoundsKey);
}
+} // namespace
+
void ToggleMaximizedState(aura::Window* window) {
if (GetRestoreBoundsInScreen(window)) {
- if (window->GetProperty(aura::client::kShowStateKey) ==
- ui::SHOW_STATE_NORMAL) {
- window->SetBounds(GetRestoreBoundsInParent(window));
+ if (ash::wm::IsWindowNormal(window)) {
+ // The only way this can happen is that we are in left/right maximized
sky 2012/08/28 15:38:36 I don't understand this if. If there are restore b
+ // state and need to really maximize.
+ gfx::Rect restore_bounds = *GetRestoreBoundsInScreen(window);
+ window->SetProperty(aura::client::kShowStateKey,
+ ui::SHOW_STATE_MAXIMIZED);
+ SetRestoreBoundsInScreen(window, restore_bounds);
} else {
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
}
@@ -50,8 +56,6 @@ void ToggleMaximizedState(aura::Window* window) {
}
}
-} // namespace
-
namespace internal {
WorkspaceEventFilter::WorkspaceEventFilter(aura::Window* owner)

Powered by Google App Engine
This is Rietveld 408576698