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

Unified Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 134603003: Resizes all docked windows that are flush with the docked edge in sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@panels
Patch Set: Resizes all docked windows that are flush with thedocked edge in sync Created 6 years, 11 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
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index 469659f3715450d4e41fd5409fd29f506cc0cab8..0866202fcefb488892d5df7b98928c4a2ddc3e53 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -16,6 +16,7 @@
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/window_animations.h"
#include "ash/wm/window_properties.h"
+#include "ash/wm/window_resizer.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace_controller.h"
@@ -429,12 +430,30 @@ void DockedWindowLayoutManager::StartDragging(aura::Window* window) {
DCHECK(!IsPopupOrTransient(window));
// Start observing a window unless it is docked container's child in which
// case it is already observed.
+ wm::WindowState* dragged_state = wm::GetWindowState(dragged_window_);
if (dragged_window_->parent() != dock_container_) {
dragged_window_->AddObserver(this);
- wm::GetWindowState(dragged_window_)->AddObserver(this);
+ dragged_state->AddObserver(this);
}
is_dragged_from_dock_ = window->parent() == dock_container_;
DCHECK(!is_dragged_window_docked_);
+
+ // Resize all windows that are flush with the dock edge together if one of
+ // them gets resized.
+ if (dragged_window_->bounds().width() == docked_width_ &&
+ (dragged_state->drag_details()->bounds_change &
+ WindowResizer::kBoundsChange_Resizes) &&
+ (dragged_state->drag_details()->size_change_direction &
+ WindowResizer::kBoundsChangeDirection_Horizontal)) {
+ for (size_t i = 0; i < dock_container_->children().size(); ++i) {
+ aura::Window* window1(dock_container_->children()[i]);
+ if (IsUsedByLayout(window1) &&
+ window1 != dragged_window_ &&
+ window1->bounds().width() == docked_width_) {
+ wm::GetWindowState(window1)->set_bounds_changed_by_user(false);
oshima 2014/01/10 23:07:28 so this will trigger resizing later on when the dr
varkha 2014/01/10 23:26:43 This allows the window to be flexible about its si
+ }
+ }
+ }
}
void DockedWindowLayoutManager::DockDraggedWindow(aura::Window* window) {
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698