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

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

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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 | « ash/wm/panels/panel_layout_manager.h ('k') | ash/wm/panels/panel_layout_manager_unittest.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 (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 #include <utility> 9 #include <utility>
10 10
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 // PanelLayoutManager, ShelfLayoutManagerObserver implementation: 527 // PanelLayoutManager, ShelfLayoutManagerObserver implementation:
528 528
529 void PanelLayoutManager::WillChangeVisibilityState( 529 void PanelLayoutManager::WillChangeVisibilityState(
530 ShelfVisibilityState new_state) { 530 ShelfVisibilityState new_state) {
531 // On entering / leaving full screen mode the shelf visibility state is 531 // On entering / leaving full screen mode the shelf visibility state is
532 // changed to / from SHELF_HIDDEN. In this state, panel windows should hide 532 // changed to / from SHELF_HIDDEN. In this state, panel windows should hide
533 // to allow the full-screen application to use the full screen. 533 // to allow the full-screen application to use the full screen.
534 bool shelf_hidden = new_state == ash::SHELF_HIDDEN; 534 bool shelf_hidden = new_state == ash::SHELF_HIDDEN;
535 if (!shelf_hidden) { 535 if (!shelf_hidden) {
536 if (restore_windows_on_shelf_visible_) { 536 if (restore_windows_on_shelf_visible_) {
537 scoped_ptr<aura::WindowTracker> restore_windows( 537 std::unique_ptr<aura::WindowTracker> restore_windows(
538 std::move(restore_windows_on_shelf_visible_)); 538 std::move(restore_windows_on_shelf_visible_));
539 for (aura::Window::Windows::const_iterator iter = 539 for (aura::Window::Windows::const_iterator iter =
540 restore_windows->windows().begin(); 540 restore_windows->windows().begin();
541 iter != restore_windows->windows().end(); ++iter) { 541 iter != restore_windows->windows().end(); ++iter) {
542 RestorePanel(*iter); 542 RestorePanel(*iter);
543 } 543 }
544 } 544 }
545 return; 545 return;
546 } 546 }
547 547
548 if (restore_windows_on_shelf_visible_) 548 if (restore_windows_on_shelf_visible_)
549 return; 549 return;
550 scoped_ptr<aura::WindowTracker> minimized_windows(new aura::WindowTracker); 550 std::unique_ptr<aura::WindowTracker> minimized_windows(
551 new aura::WindowTracker);
551 for (PanelList::iterator iter = panel_windows_.begin(); 552 for (PanelList::iterator iter = panel_windows_.begin();
552 iter != panel_windows_.end();) { 553 iter != panel_windows_.end();) {
553 aura::Window* window = iter->window; 554 aura::Window* window = iter->window;
554 // Minimizing a panel window may remove it from the panel_windows_ list. 555 // Minimizing a panel window may remove it from the panel_windows_ list.
555 // Advance the iterator before minimizing it: http://crbug.com/393047. 556 // Advance the iterator before minimizing it: http://crbug.com/393047.
556 ++iter; 557 ++iter;
557 if (window != dragged_panel_ && window->IsVisible()) { 558 if (window != dragged_panel_ && window->IsVisible()) {
558 minimized_windows->Add(window); 559 minimized_windows->Add(window);
559 wm::GetWindowState(window)->Minimize(); 560 wm::GetWindowState(window)->Minimize();
560 } 561 }
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 // Keyboard hidden, restore original bounds if they exist. 929 // Keyboard hidden, restore original bounds if they exist.
929 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); 930 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen());
930 } 931 }
931 } 932 }
932 // This bounds change will have caused a change to the Shelf which does not 933 // This bounds change will have caused a change to the Shelf which does not
933 // propogate automatically to this class, so manually recalculate bounds. 934 // propogate automatically to this class, so manually recalculate bounds.
934 OnWindowResized(); 935 OnWindowResized();
935 } 936 }
936 937
937 } // namespace ash 938 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager.h ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698