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

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

Issue 1056793006: [Docking] Persists docked state on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Docking] Makes docked state persistent on Chrome OS (comments) Created 5 years, 7 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
« no previous file with comments | « no previous file | ash/wm/window_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_resizer.h" 5 #include "ash/wm/dock/docked_window_resizer.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shelf/shelf.h" 10 #include "ash/shelf/shelf.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 aura::Window* previous_parent = window->parent(); 292 aura::Window* previous_parent = window->parent();
293 aura::client::ParentWindowWithContext(window, window, near_last_location); 293 aura::client::ParentWindowWithContext(window, window, near_last_location);
294 if (window->parent() != previous_parent) { 294 if (window->parent() != previous_parent) {
295 wm::ReparentTransientChildrenOfChild(window, 295 wm::ReparentTransientChildrenOfChild(window,
296 previous_parent, 296 previous_parent,
297 window->parent()); 297 window->parent());
298 } 298 }
299 action = was_docked_ ? DOCKED_ACTION_UNDOCK : DOCKED_ACTION_NONE; 299 action = was_docked_ ? DOCKED_ACTION_UNDOCK : DOCKED_ACTION_NONE;
300 } 300 }
301 } else { 301 } else {
302 // Docked state was not changed but still need to record a UMA action. 302 // |action| is recorded in UMA and used to maintain |window_state_|.
303 if (is_resized && is_docked_ && was_docked_) 303 if (is_resized && is_docked_ && was_docked_)
304 action = DOCKED_ACTION_RESIZE; 304 action = DOCKED_ACTION_RESIZE;
305 else if (is_docked_ && was_docked_) 305 else if (is_docked_ && was_docked_)
306 action = DOCKED_ACTION_REORDER; 306 action = DOCKED_ACTION_REORDER;
307 else if (is_docked_ && !was_docked_) 307 else if (is_docked_ && !was_docked_)
308 action = DOCKED_ACTION_DOCK; 308 action = DOCKED_ACTION_DOCK;
309 else if (!is_docked_ && was_docked_)
310 action = DOCKED_ACTION_UNDOCK;
309 else 311 else
310 action = DOCKED_ACTION_NONE; 312 action = DOCKED_ACTION_NONE;
311 } 313 }
312 // When a window is newly docked it is auto-sized by docked layout adjusting 314 // When a window is newly docked it is auto-sized by docked layout adjusting
313 // to other windows. If it is just dragged (but not resized) while being 315 // to other windows. If it is just dragged (but not resized) while being
314 // docked it is auto-sized unless it has been resized while being docked 316 // docked it is auto-sized unless it has been resized while being docked
315 // before. 317 // before.
316 if (is_docked_) { 318 if (is_docked_) {
317 wm::GetWindowState(window)->set_bounds_changed_by_user( 319 wm::GetWindowState(window)->set_bounds_changed_by_user(
318 was_docked_ && (is_resized || was_bounds_changed_by_user_)); 320 was_docked_ && (is_resized || was_bounds_changed_by_user_));
319 } 321 }
320 322
321 if (action == DOCKED_ACTION_DOCK) { 323 if (action == DOCKED_ACTION_DOCK) {
322 const wm::WMEvent event(wm::WM_EVENT_DOCK); 324 const wm::WMEvent event(wm::WM_EVENT_DOCK);
323 window_state_->OnWMEvent(&event); 325 window_state_->OnWMEvent(&event);
324 } else if (wm::GetWindowState(window)->IsDocked() && 326 } else if (wm::GetWindowState(window)->IsDocked() &&
325 action == DOCKED_ACTION_UNDOCK) { 327 action == DOCKED_ACTION_UNDOCK) {
326 const wm::WMEvent event(wm::WM_EVENT_NORMAL); 328 const wm::WMEvent event(wm::WM_EVENT_NORMAL);
327 window_state_->OnWMEvent(&event); 329 window_state_->OnWMEvent(&event);
328 } 330 }
329 331
330 return action; 332 return action;
331 } 333 }
332 334
333 } // namespace ash 335 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698