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

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..86ef404531e43dcc929d3b05199981738cbf3eb8 100644
--- a/ash/wm/workspace/workspace_event_filter.cc
+++ b/ash/wm/workspace/workspace_event_filter.cc
@@ -37,19 +37,6 @@ void SingleAxisUnmaximize(aura::Window* window,
window->ClearProperty(aura::client::kRestoreBoundsKey);
}
-void ToggleMaximizedState(aura::Window* window) {
- if (GetRestoreBoundsInScreen(window)) {
- if (window->GetProperty(aura::client::kShowStateKey) ==
- ui::SHOW_STATE_NORMAL) {
- window->SetBounds(GetRestoreBoundsInParent(window));
- } else {
- window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
- }
- } else {
- window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
- }
-}
-
} // namespace
namespace internal {
@@ -86,7 +73,7 @@ bool WorkspaceEventFilter::PreHandleMouseEvent(aura::Window* target,
HTCAPTION) {
bool destroyed = false;
destroyed_ = &destroyed;
- ToggleMaximizedState(target);
+ ash::wm::ToggleMaximizedState(target);
if (destroyed)
return false;
destroyed_ = NULL;
@@ -107,7 +94,7 @@ ui::GestureStatus WorkspaceEventFilter::PreHandleGestureEvent(
if (event->type() == ui::ET_GESTURE_DOUBLE_TAP &&
target->delegate()->GetNonClientComponent(event->location()) ==
HTCAPTION) {
- ToggleMaximizedState(target); // |this| may be destroyed from here.
+ ash::wm::ToggleMaximizedState(target); // |this| may be destroyed here.
return ui::GESTURE_STATUS_CONSUMED;
}
return ToplevelWindowEventFilter::PreHandleGestureEvent(target, event);

Powered by Google App Engine
This is Rietveld 408576698