OLD | NEW |
---|---|
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/wm/overview/scoped_overview_animation_settings_factory.h" | 5 #include "ash/wm/overview/scoped_overview_animation_settings_factory.h" |
6 | 6 |
7 #include "ash/wm/overview/scoped_overview_animation_settings.h" | |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ptr_util.h" | |
10 #include "ui/aura/window.h" | |
msw
2017/05/24 17:39:16
optional nit: probably not necessary
varkha
2017/05/24 18:29:51
Acknowledged (class removed).
| |
8 | 11 |
9 namespace ash { | 12 namespace ash { |
10 | 13 |
11 // static | 14 // static |
12 ScopedOverviewAnimationSettingsFactory* | 15 ScopedOverviewAnimationSettingsFactory* |
13 ScopedOverviewAnimationSettingsFactory::instance_ = nullptr; | 16 ScopedOverviewAnimationSettingsFactory::instance_ = nullptr; |
14 | 17 |
15 // static | 18 // static |
16 ScopedOverviewAnimationSettingsFactory* | 19 ScopedOverviewAnimationSettingsFactory* |
17 ScopedOverviewAnimationSettingsFactory::Get() { | 20 ScopedOverviewAnimationSettingsFactory::Get() { |
18 return instance_; | 21 return instance_; |
19 } | 22 } |
20 | 23 |
21 ScopedOverviewAnimationSettingsFactory:: | 24 ScopedOverviewAnimationSettingsFactory:: |
22 ScopedOverviewAnimationSettingsFactory() { | 25 ScopedOverviewAnimationSettingsFactory() { |
23 DCHECK(!instance_); | 26 DCHECK(!instance_); |
24 instance_ = this; | 27 instance_ = this; |
25 } | 28 } |
26 | 29 |
27 ScopedOverviewAnimationSettingsFactory:: | 30 ScopedOverviewAnimationSettingsFactory:: |
28 ~ScopedOverviewAnimationSettingsFactory() { | 31 ~ScopedOverviewAnimationSettingsFactory() { |
29 DCHECK_EQ(instance_, this); | 32 DCHECK_EQ(instance_, this); |
30 instance_ = nullptr; | 33 instance_ = nullptr; |
31 } | 34 } |
32 | 35 |
36 std::unique_ptr<ScopedOverviewAnimationSettings> | |
37 ScopedOverviewAnimationSettingsFactory::CreateOverviewAnimationSettings( | |
38 OverviewAnimationType animation_type, | |
39 aura::Window* window) { | |
40 return base::MakeUnique<ScopedOverviewAnimationSettings>(animation_type, | |
41 window); | |
42 } | |
43 | |
33 } // namespace ash | 44 } // namespace ash |
OLD | NEW |