OLD | NEW |
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/common/system/tray/tray_item_view.h" | 5 #include "ash/common/system/tray/tray_item_view.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "ash/common/shelf/wm_shelf_util.h" | 8 #include "ash/common/shelf/wm_shelf_util.h" |
9 #include "ash/common/system/tray/system_tray.h" | 9 #include "ash/common/system/tray/system_tray.h" |
10 #include "ash/common/system/tray/system_tray_item.h" | 10 #include "ash/common/system/tray/system_tray_item.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 const int kTrayItemAnimationDurationMS = 200; | 23 const int kTrayItemAnimationDurationMS = 200; |
24 | 24 |
25 // Animations can be disabled for testing. | 25 // Animations can be disabled for testing. |
26 bool animations_enabled = true; | 26 bool animations_enabled = true; |
27 } | 27 } |
28 | 28 |
29 namespace ash { | 29 namespace ash { |
30 | 30 |
31 TrayItemView::TrayItemView(SystemTrayItem* owner) | 31 TrayItemView::TrayItemView(SystemTrayItem* owner) |
32 : owner_(owner), label_(NULL), image_view_(NULL) { | 32 : owner_(owner), label_(NULL), image_view_(NULL) { |
33 SetPaintToLayer(true); | 33 SetPaintToLayer(); |
34 layer()->SetFillsBoundsOpaquely(false); | 34 layer()->SetFillsBoundsOpaquely(false); |
35 SetLayoutManager(new views::FillLayout()); | 35 SetLayoutManager(new views::FillLayout()); |
36 } | 36 } |
37 | 37 |
38 TrayItemView::~TrayItemView() {} | 38 TrayItemView::~TrayItemView() {} |
39 | 39 |
40 // static | 40 // static |
41 void TrayItemView::DisableAnimationsForTest() { | 41 void TrayItemView::DisableAnimationsForTest() { |
42 animations_enabled = false; | 42 animations_enabled = false; |
43 } | 43 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 void TrayItemView::AnimationEnded(const gfx::Animation* animation) { | 141 void TrayItemView::AnimationEnded(const gfx::Animation* animation) { |
142 if (animation->GetCurrentValue() < 0.1) | 142 if (animation->GetCurrentValue() < 0.1) |
143 views::View::SetVisible(false); | 143 views::View::SetVisible(false); |
144 } | 144 } |
145 | 145 |
146 void TrayItemView::AnimationCanceled(const gfx::Animation* animation) { | 146 void TrayItemView::AnimationCanceled(const gfx::Animation* animation) { |
147 AnimationEnded(animation); | 147 AnimationEnded(animation); |
148 } | 148 } |
149 | 149 |
150 } // namespace ash | 150 } // namespace ash |
OLD | NEW |