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

Side by Side Diff: ash/accelerators/accelerator_controller_delegate_aura.cc

Issue 2550933002: Make all LayerAnimationElement::Create*Element return unique_ptr (Closed)
Patch Set: Complete inclusion Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/accelerators/accelerator_controller_delegate_aura.h" 5 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 18 matching lines...) Expand all
29 #include "ash/root_window_controller.h" 29 #include "ash/root_window_controller.h"
30 #include "ash/rotator/screen_rotation_animator.h" 30 #include "ash/rotator/screen_rotation_animator.h"
31 #include "ash/rotator/window_rotation.h" 31 #include "ash/rotator/window_rotation.h"
32 #include "ash/screenshot_delegate.h" 32 #include "ash/screenshot_delegate.h"
33 #include "ash/shell.h" 33 #include "ash/shell.h"
34 #include "ash/touch/touch_hud_debug.h" 34 #include "ash/touch/touch_hud_debug.h"
35 #include "ash/utility/screenshot_controller.h" 35 #include "ash/utility/screenshot_controller.h"
36 #include "ash/wm/power_button_controller.h" 36 #include "ash/wm/power_button_controller.h"
37 #include "ash/wm/window_state_aura.h" 37 #include "ash/wm/window_state_aura.h"
38 #include "ash/wm/window_util.h" 38 #include "ash/wm/window_util.h"
39 #include "base/memory/ptr_util.h"
39 #include "base/metrics/histogram_macros.h" 40 #include "base/metrics/histogram_macros.h"
40 #include "base/metrics/user_metrics.h" 41 #include "base/metrics/user_metrics.h"
41 #include "base/strings/string_split.h" 42 #include "base/strings/string_split.h"
42 #include "base/strings/utf_string_conversions.h" 43 #include "base/strings/utf_string_conversions.h"
43 #include "third_party/skia/include/core/SkColor.h" 44 #include "third_party/skia/include/core/SkColor.h"
44 #include "third_party/skia/include/core/SkPaint.h" 45 #include "third_party/skia/include/core/SkPaint.h"
45 #include "ui/base/accelerators/accelerator.h" 46 #include "ui/base/accelerators/accelerator.h"
46 #include "ui/base/l10n/l10n_util.h" 47 #include "ui/base/l10n/l10n_util.h"
47 #include "ui/compositor/layer.h" 48 #include "ui/compositor/layer.h"
48 #include "ui/compositor/layer_animation_sequence.h" 49 #include "ui/compositor/layer_animation_sequence.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 aura::Window* active_window = wm::GetActiveWindow(); 181 aura::Window* active_window = wm::GetActiveWindow();
181 if (active_window) { 182 if (active_window) {
182 // The rotation animation bases its target transform on the current 183 // The rotation animation bases its target transform on the current
183 // rotation and position. Since there could be an animation in progress 184 // rotation and position. Since there could be an animation in progress
184 // right now, queue this animation so when it starts it picks up a neutral 185 // right now, queue this animation so when it starts it picks up a neutral
185 // rotation and position. Use replace so we only enqueue one at a time. 186 // rotation and position. Use replace so we only enqueue one at a time.
186 active_window->layer()->GetAnimator()->set_preemption_strategy( 187 active_window->layer()->GetAnimator()->set_preemption_strategy(
187 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); 188 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
188 active_window->layer()->GetAnimator()->StartAnimation( 189 active_window->layer()->GetAnimator()->StartAnimation(
189 new ui::LayerAnimationSequence( 190 new ui::LayerAnimationSequence(
190 new WindowRotation(360, active_window->layer()))); 191 base::MakeUnique<WindowRotation>(360, active_window->layer())));
191 } 192 }
192 } 193 }
193 194
194 void HandleShowSystemTrayBubble() { 195 void HandleShowSystemTrayBubble() {
195 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); 196 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble"));
196 RootWindowController* controller = 197 RootWindowController* controller =
197 RootWindowController::ForTargetRootWindow(); 198 RootWindowController::ForTargetRootWindow();
198 SystemTray* tray = controller->GetSystemTray(); 199 SystemTray* tray = controller->GetSystemTray();
199 if (!tray->HasSystemBubble()) { 200 if (!tray->HasSystemBubble()) {
200 tray->ShowDefaultView(BUBBLE_CREATE_NEW); 201 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 message_center::NotifierId( 501 message_center::NotifierId(
501 message_center::NotifierId::SYSTEM_COMPONENT, 502 message_center::NotifierId::SYSTEM_COMPONENT,
502 system_notifier::kNotifierDeprecatedAccelerator), 503 system_notifier::kNotifierDeprecatedAccelerator),
503 message_center::RichNotificationData(), 504 message_center::RichNotificationData(),
504 new DeprecatedAcceleratorNotificationDelegate)); 505 new DeprecatedAcceleratorNotificationDelegate));
505 message_center::MessageCenter::Get()->AddNotification( 506 message_center::MessageCenter::Get()->AddNotification(
506 std::move(notification)); 507 std::move(notification));
507 } 508 }
508 509
509 } // namespace ash 510 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/rotator/screen_rotation_animation.cc » ('j') | ui/compositor/layer_animation_sequence.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698