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

Side by Side Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 597683003: Add window states docked; and docked minimized. Add wm window event to set docked and undocked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dock
Patch Set: Add docked window states Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/dock/docked_window_layout_manager.h" 5 #include "ash/wm/dock/docked_window_layout_manager.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_constants.h" 9 #include "ash/shelf/shelf_constants.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 void DockedWindowLayoutManager::OnPreWindowStateTypeChange( 808 void DockedWindowLayoutManager::OnPreWindowStateTypeChange(
809 wm::WindowState* window_state, 809 wm::WindowState* window_state,
810 wm::WindowStateType old_type) { 810 wm::WindowStateType old_type) {
811 aura::Window* window = window_state->window(); 811 aura::Window* window = window_state->window();
812 if (IsPopupOrTransient(window)) 812 if (IsPopupOrTransient(window))
813 return; 813 return;
814 // The window property will still be set, but no actual change will occur 814 // The window property will still be set, but no actual change will occur
815 // until OnFullscreenStateChange is called when exiting fullscreen. 815 // until OnFullscreenStateChange is called when exiting fullscreen.
816 if (in_fullscreen_) 816 if (in_fullscreen_)
817 return; 817 return;
818 if (window_state->IsMinimized()) { 818 if (!window_state->IsDocked() ||
819 MinimizeDockedWindow(window_state); 819 window_state->IsMaximizedOrFullscreen() ||
820 } else if (window_state->IsMaximizedOrFullscreen() || 820 window_state->IsSnapped()) {
821 window_state->IsSnapped()) {
822 if (window != dragged_window_) { 821 if (window != dragged_window_) {
823 UndockWindow(window); 822 UndockWindow(window);
824 RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN); 823 RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN);
varkha 2014/09/25 22:09:28 I think we would need to record a new event source
dtapuska 2014/09/26 14:17:07 I've adjusted the logic entry condition since the
825 } 824 }
826 } else if (old_type == wm::WINDOW_STATE_TYPE_MINIMIZED) { 825 } else if (window_state->IsMinimized()) {
826 MinimizeDockedWindow(window_state);
827 } else if (old_type == wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED) {
827 RestoreDockedWindow(window_state); 828 RestoreDockedWindow(window_state);
828 } 829 }
829 } 830 }
830 831
831 ///////////////////////////////////////////////////////////////////////////// 832 /////////////////////////////////////////////////////////////////////////////
832 // DockedWindowLayoutManager, WindowObserver implementation: 833 // DockedWindowLayoutManager, WindowObserver implementation:
833 834
834 void DockedWindowLayoutManager::OnWindowBoundsChanged( 835 void DockedWindowLayoutManager::OnWindowBoundsChanged(
835 aura::Window* window, 836 aura::Window* window,
836 const gfx::Rect& old_bounds, 837 const gfx::Rect& old_bounds,
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 1321
1321 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( 1322 void DockedWindowLayoutManager::OnKeyboardBoundsChanging(
1322 const gfx::Rect& keyboard_bounds) { 1323 const gfx::Rect& keyboard_bounds) {
1323 // This bounds change will have caused a change to the Shelf which does not 1324 // This bounds change will have caused a change to the Shelf which does not
1324 // propagate automatically to this class, so manually recalculate bounds. 1325 // propagate automatically to this class, so manually recalculate bounds.
1325 Relayout(); 1326 Relayout();
1326 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); 1327 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING);
1327 } 1328 }
1328 1329
1329 } // namespace ash 1330 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698