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

Side by Side Diff: ash/wm/panels/panel_layout_manager.cc

Issue 594383002: Change behaviour of the Alt-] and Alt-[ keys so that it cycles through SnapLeft/SnapRight to DockLe… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@event
Patch Set: Address DockLeft/DockRight issues 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/panels/panel_layout_manager.h" 5 #include "ash/wm/panels/panel_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (key == kShelfID) 480 if (key == kShelfID)
481 Relayout(); 481 Relayout();
482 } 482 }
483 483
484 ///////////////////////////////////////////////////////////////////////////// 484 /////////////////////////////////////////////////////////////////////////////
485 // PanelLayoutManager, WindowStateObserver implementation: 485 // PanelLayoutManager, WindowStateObserver implementation:
486 486
487 void PanelLayoutManager::OnPostWindowStateTypeChange( 487 void PanelLayoutManager::OnPostWindowStateTypeChange(
488 wm::WindowState* window_state, 488 wm::WindowState* window_state,
489 wm::WindowStateType old_type) { 489 wm::WindowStateType old_type) {
490 // If the shelf is currently hidden then windows will not actually be shown 490 aura::Window* window = window_state->window();
varkha 2014/09/29 21:04:34 Since you have this you could s/'window_state->win
dtapuska 2014/09/30 14:40:49 Done.
491 // but the set to restore when the shelf becomes visible is updated. 491 if (window_state->IsDocked()) {
492 if (restore_windows_on_shelf_visible_) { 492 wm::DockWindow(window);
varkha 2014/09/29 21:04:34 Just a question - is this what allows the accelera
dtapuska 2014/09/30 14:40:49 Yes; a panel is in the panel layout manager; and i
493 if (window_state->IsMinimized()) { 493 } else {
494 // If the shelf is currently hidden then windows will not actually be shown
495 // but the set to restore when the shelf becomes visible is updated.
496 if (restore_windows_on_shelf_visible_) {
497 if (window_state->IsMinimized()) {
498 MinimizePanel(window_state->window());
499 restore_windows_on_shelf_visible_->Remove(window_state->window());
500 } else {
501 restore_windows_on_shelf_visible_->Add(window_state->window());
502 }
503 return;
504 }
505
506 if (window_state->IsMinimized())
494 MinimizePanel(window_state->window()); 507 MinimizePanel(window_state->window());
495 restore_windows_on_shelf_visible_->Remove(window_state->window()); 508 else
496 } else { 509 RestorePanel(window_state->window());
497 restore_windows_on_shelf_visible_->Add(window_state->window());
498 }
499 return;
500 } 510 }
501
502 if (window_state->IsMinimized())
503 MinimizePanel(window_state->window());
504 else
505 RestorePanel(window_state->window());
506 } 511 }
507 512
508 //////////////////////////////////////////////////////////////////////////////// 513 ////////////////////////////////////////////////////////////////////////////////
509 // PanelLayoutManager, aura::client::ActivationChangeObserver implementation: 514 // PanelLayoutManager, aura::client::ActivationChangeObserver implementation:
510 515
511 void PanelLayoutManager::OnWindowActivated(aura::Window* gained_active, 516 void PanelLayoutManager::OnWindowActivated(aura::Window* gained_active,
512 aura::Window* lost_active) { 517 aura::Window* lost_active) {
513 // Ignore if the panel that is not managed by this was activated. 518 // Ignore if the panel that is not managed by this was activated.
514 if (gained_active && gained_active->type() == ui::wm::WINDOW_TYPE_PANEL && 519 if (gained_active && gained_active->type() == ui::wm::WINDOW_TYPE_PANEL &&
515 gained_active->parent() == panel_container_) { 520 gained_active->parent() == panel_container_) {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 // Keyboard hidden, restore original bounds if they exist. 941 // Keyboard hidden, restore original bounds if they exist.
937 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); 942 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen());
938 } 943 }
939 } 944 }
940 // This bounds change will have caused a change to the Shelf which does not 945 // This bounds change will have caused a change to the Shelf which does not
941 // propogate automatically to this class, so manually recalculate bounds. 946 // propogate automatically to this class, so manually recalculate bounds.
942 OnWindowResized(); 947 OnWindowResized();
943 } 948 }
944 949
945 } // namespace ash 950 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698