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

Side by Side Diff: ash/wm/dock/docked_window_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
OLDNEW
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/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_constants.h" 9 #include "ash/shelf/shelf_constants.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // Transitions to |visible_background_type_| if the widget is visible and to 155 // Transitions to |visible_background_type_| if the widget is visible and to
156 // SHELF_BACKGROUND_DEFAULT if it is not. 156 // SHELF_BACKGROUND_DEFAULT if it is not.
157 void UpdateBackground() { 157 void UpdateBackground() {
158 ShelfBackgroundType background_type = IsVisible() ? 158 ShelfBackgroundType background_type = IsVisible() ?
159 visible_background_type_ : SHELF_BACKGROUND_DEFAULT; 159 visible_background_type_ : SHELF_BACKGROUND_DEFAULT;
160 BackgroundAnimatorChangeType change_type = IsVisible() ? 160 BackgroundAnimatorChangeType change_type = IsVisible() ?
161 visible_background_change_type_ : BACKGROUND_CHANGE_IMMEDIATE; 161 visible_background_change_type_ : BACKGROUND_CHANGE_IMMEDIATE;
162 162
163 float target_opacity = 163 float target_opacity =
164 (background_type == SHELF_BACKGROUND_MAXIMIZED) ? 1.0f : 0.0f; 164 (background_type == SHELF_BACKGROUND_MAXIMIZED) ? 1.0f : 0.0f;
165 scoped_ptr<ui::ScopedLayerAnimationSettings> opaque_background_animation; 165 std::unique_ptr<ui::ScopedLayerAnimationSettings>
166 opaque_background_animation;
166 if (change_type != BACKGROUND_CHANGE_IMMEDIATE) { 167 if (change_type != BACKGROUND_CHANGE_IMMEDIATE) {
167 opaque_background_animation.reset(new ui::ScopedLayerAnimationSettings( 168 opaque_background_animation.reset(new ui::ScopedLayerAnimationSettings(
168 opaque_background_.GetAnimator())); 169 opaque_background_.GetAnimator()));
169 opaque_background_animation->SetTransitionDuration( 170 opaque_background_animation->SetTransitionDuration(
170 base::TimeDelta::FromMilliseconds(kTimeToSwitchBackgroundMs)); 171 base::TimeDelta::FromMilliseconds(kTimeToSwitchBackgroundMs));
171 } 172 }
172 opaque_background_.SetOpacity(target_opacity); 173 opaque_background_.SetOpacity(target_opacity);
173 174
174 // TODO(varkha): use ui::Layer on both opaque_background and normal 175 // TODO(varkha): use ui::Layer on both opaque_background and normal
175 // background retire background_animator_ at all. It would be simpler. 176 // background retire background_animator_ at all. It would be simpler.
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 1359
1359 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( 1360 void DockedWindowLayoutManager::OnKeyboardBoundsChanging(
1360 const gfx::Rect& keyboard_bounds) { 1361 const gfx::Rect& keyboard_bounds) {
1361 // This bounds change will have caused a change to the Shelf which does not 1362 // This bounds change will have caused a change to the Shelf which does not
1362 // propagate automatically to this class, so manually recalculate bounds. 1363 // propagate automatically to this class, so manually recalculate bounds.
1363 Relayout(); 1364 Relayout();
1364 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); 1365 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING);
1365 } 1366 }
1366 1367
1367 } // namespace ash 1368 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.h ('k') | ash/wm/dock/docked_window_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698