summaryrefslogtreecommitdiffstats
path: root/ash/wm/maximize_mode/maximize_mode_window_manager.cc
diff options
context:
space:
mode:
authorskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 05:34:34 +0000
committerskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 05:34:34 +0000
commitb19b09acc83a0384520764570f643dda129f804a (patch)
tree97da591d723add9fceb0b4abf6a216189addce9c /ash/wm/maximize_mode/maximize_mode_window_manager.cc
parentd05cf2f1ab93b70f152cb673a102ef2d0e125a72 (diff)
downloadchromium_src-b19b09acc83a0384520764570f643dda129f804a.zip
chromium_src-b19b09acc83a0384520764570f643dda129f804a.tar.gz
chromium_src-b19b09acc83a0384520764570f643dda129f804a.tar.bz2
Adding hotkey behind a commandline to allow testing the TouchView maximizing mode.
The flag and the hotkey is only temporary since there is no other way to test the TouchView functionality at this time. BUG=337563 TEST=visual Review URL: https://codereview.chromium.org/179063002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/maximize_mode/maximize_mode_window_manager.cc')
-rw-r--r--ash/wm/maximize_mode/maximize_mode_window_manager.cc30
1 files changed, 17 insertions, 13 deletions
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager.cc b/ash/wm/maximize_mode/maximize_mode_window_manager.cc
index 6360450..a265bdb 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager.cc
@@ -58,13 +58,11 @@ void MaximizeModeWindowManager::OnDisplayBoundsChanged(
}
void MaximizeModeWindowManager::OnDisplayAdded(const gfx::Display& display) {
- RemoveWindowCreationObservers();
- AddWindowCreationObservers();
-
+ DisplayConfigurationChanged();
}
+
void MaximizeModeWindowManager::OnDisplayRemoved(const gfx::Display& display) {
- RemoveWindowCreationObservers();
- AddWindowCreationObservers();
+ DisplayConfigurationChanged();
}
MaximizeModeWindowManager::MaximizeModeWindowManager() {
@@ -133,14 +131,15 @@ void MaximizeModeWindowManager::RestoreAndForgetWindow(
if (!CanMaximize(window)) {
// TODO(skuhne): Remove the background cover layer.
ash::wm::WindowState* window_state = ash::wm::GetWindowState(window);
- DCHECK(window_state->HasRestoreBounds());
- gfx::Rect initial_bounds =
- window->parent() ? window_state->GetRestoreBoundsInParent() :
- window_state->GetRestoreBoundsInScreen();
- window_state->ClearRestoreBounds();
- // TODO(skuhne): The screen might have changed and we should make it
- // visible area again.
- window->SetBounds(initial_bounds);
+ if (window_state->HasRestoreBounds()) {
+ gfx::Rect initial_bounds =
+ window->parent() ? window_state->GetRestoreBoundsInParent() :
+ window_state->GetRestoreBoundsInScreen();
+ window_state->ClearRestoreBounds();
+ // TODO(skuhne): The screen might have changed and we should make sure
+ // that the bounds are in a visible area.
+ window->SetBounds(initial_bounds);
+ }
} else {
// If the window neither was minimized or maximized and it is currently
// not minimized, we restore it.
@@ -213,6 +212,11 @@ void MaximizeModeWindowManager::RemoveWindowCreationObservers() {
observed_container_windows_.clear();
}
+void MaximizeModeWindowManager::DisplayConfigurationChanged() {
+ RemoveWindowCreationObservers();
+ AddWindowCreationObservers();
+}
+
bool MaximizeModeWindowManager::IsContainerWindow(aura::Window* window) {
return observed_container_windows_.find(window) !=
observed_container_windows_.end();