OLD | NEW |
---|---|
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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 if (window != dragged_window_ && !IsPopupOrTransient(window)) | 372 if (window != dragged_window_ && !IsPopupOrTransient(window)) |
373 return alignment_; | 373 return alignment_; |
374 } | 374 } |
375 // No docked windows remain other than possibly the window being dragged. | 375 // No docked windows remain other than possibly the window being dragged. |
376 // Return |NONE| to indicate that windows may get docked on either side. | 376 // Return |NONE| to indicate that windows may get docked on either side. |
377 return DOCKED_ALIGNMENT_NONE; | 377 return DOCKED_ALIGNMENT_NONE; |
378 } | 378 } |
379 | 379 |
380 bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window, | 380 bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window, |
381 SnapType edge) { | 381 SnapType edge) { |
382 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 382 if (!switches::UseDockedWindows()) { |
flackr
2013/11/01 16:52:28
nit: no curlies { }
varkha
2013/11/05 20:34:23
Done.
| |
383 switches::kAshEnableDockedWindows)) { | |
384 return false; | 383 return false; |
385 } | 384 } |
386 // Don't allow interactive docking of windows with transient parents such as | 385 // Don't allow interactive docking of windows with transient parents such as |
387 // modal browser dialogs. | 386 // modal browser dialogs. |
388 if (IsPopupOrTransient(window)) | 387 if (IsPopupOrTransient(window)) |
389 return false; | 388 return false; |
390 // If a window is wide and cannot be resized down to maximum width allowed | 389 // If a window is wide and cannot be resized down to maximum width allowed |
391 // then it cannot be docked. | 390 // then it cannot be docked. |
392 // TODO(varkha). Prevent windows from changing size programmatically while | 391 // TODO(varkha). Prevent windows from changing size programmatically while |
393 // they are docked. The size will take effect only once a window is undocked. | 392 // they are docked. The size will take effect only once a window is undocked. |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1014 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1013 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
1015 const gfx::Rect& keyboard_bounds) { | 1014 const gfx::Rect& keyboard_bounds) { |
1016 // This bounds change will have caused a change to the Shelf which does not | 1015 // This bounds change will have caused a change to the Shelf which does not |
1017 // propagate automatically to this class, so manually recalculate bounds. | 1016 // propagate automatically to this class, so manually recalculate bounds. |
1018 Relayout(); | 1017 Relayout(); |
1019 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1018 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
1020 } | 1019 } |
1021 | 1020 |
1022 } // namespace internal | 1021 } // namespace internal |
1023 } // namespace ash | 1022 } // namespace ash |
OLD | NEW |