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

Side by Side Diff: ash/first_run/desktop_cleaner.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/first_run/desktop_cleaner.h ('k') | ash/first_run/first_run_helper.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/first_run/desktop_cleaner.h" 5 #include "ash/first_run/desktop_cleaner.h"
6 6
7 #include "ash/common/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ui/aura/window_event_dispatcher.h" 9 #include "ui/aura/window_event_dispatcher.h"
10 #include "ui/aura/window_observer.h" 10 #include "ui/aura/window_observer.h"
11 #include "ui/compositor/layer_animation_observer.h" 11 #include "ui/compositor/layer_animation_observer.h"
12 #include "ui/compositor/scoped_layer_animation_settings.h" 12 #include "ui/compositor/scoped_layer_animation_settings.h"
13 #include "ui/message_center/message_center.h" 13 #include "ui/message_center/message_center.h"
14 #include "ui/message_center/notification_blocker.h" 14 #include "ui/message_center/notification_blocker.h"
15 15
16 namespace ash { 16 namespace ash {
17 namespace { 17 namespace {
18 18
19 const int kContainerIdsToHide[] = { 19 const int kContainerIdsToHide[] = {
20 kShellWindowId_DefaultContainer, 20 kShellWindowId_DefaultContainer, kShellWindowId_AlwaysOnTopContainer,
21 kShellWindowId_AlwaysOnTopContainer, 21 kShellWindowId_PanelContainer,
22 kShellWindowId_PanelContainer, 22 // TODO(dzhioev): uncomment this when issue with BrowserView::CanActivate
23 // TODO(dzhioev): uncomment this when issue with BrowserView::CanActivate 23 // will be fixed.
24 // will be fixed. 24 // kShellWindowId_SystemModalContainer
25 // kShellWindowId_SystemModalContainer
26 }; 25 };
27 26
28 } // namespace 27 } // namespace
29 28
30 class ContainerHider : public aura::WindowObserver, 29 class ContainerHider : public aura::WindowObserver,
31 public ui::ImplicitAnimationObserver { 30 public ui::ImplicitAnimationObserver {
32 public: 31 public:
33 explicit ContainerHider(aura::Window* container) 32 explicit ContainerHider(aura::Window* container)
34 : container_was_hidden_(!container->IsVisible()), 33 : container_was_hidden_(!container->IsVisible()), container_(container) {
35 container_(container) {
36 if (container_was_hidden_) 34 if (container_was_hidden_)
37 return; 35 return;
38 ui::Layer* layer = container_->layer(); 36 ui::Layer* layer = container_->layer();
39 ui::ScopedLayerAnimationSettings animation_settings(layer->GetAnimator()); 37 ui::ScopedLayerAnimationSettings animation_settings(layer->GetAnimator());
40 animation_settings.AddObserver(this); 38 animation_settings.AddObserver(this);
41 layer->SetOpacity(0.0); 39 layer->SetOpacity(0.0);
42 } 40 }
43 41
44 ~ContainerHider() override { 42 ~ContainerHider() override {
45 if (container_was_hidden_ || !container_) 43 if (container_was_hidden_ || !container_)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 102
105 DesktopCleaner::~DesktopCleaner() {} 103 DesktopCleaner::~DesktopCleaner() {}
106 104
107 // static 105 // static
108 std::vector<int> DesktopCleaner::GetContainersToHideForTest() { 106 std::vector<int> DesktopCleaner::GetContainersToHideForTest() {
109 return std::vector<int>(kContainerIdsToHide, 107 return std::vector<int>(kContainerIdsToHide,
110 kContainerIdsToHide + arraysize(kContainerIdsToHide)); 108 kContainerIdsToHide + arraysize(kContainerIdsToHide));
111 } 109 }
112 110
113 } // namespace ash 111 } // namespace ash
114
OLDNEW
« no previous file with comments | « ash/first_run/desktop_cleaner.h ('k') | ash/first_run/first_run_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698