Chromium Code Reviews| 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/web_notification/web_notification_tray.h" | 5 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 parent()->RemoveChildView(this); | 170 parent()->RemoveChildView(this); |
| 171 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 171 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
| 172 } else { | 172 } else { |
| 173 delete_after_animation_ = true; | 173 delete_after_animation_ = true; |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 protected: | 177 protected: |
| 178 // Overridden from views::View: | 178 // Overridden from views::View: |
| 179 gfx::Size GetPreferredSize() const override { | 179 gfx::Size GetPreferredSize() const override { |
| 180 if (!animation_.get() || !animation_->is_animating()) | |
|
yoshiki
2016/08/18 08:39:08
Please don't remove this. This is a short circuit
yiyix
2016/08/18 20:01:43
I am so sorry, i removed it as I tray different so
| |
| 181 return kTrayItemOuterSize; | |
| 182 | |
| 183 // Animate the width (or height) when this item shows (or hides) so that | 180 // Animate the width (or height) when this item shows (or hides) so that |
| 184 // the icons on the left are shifted with the animation. | 181 // the icons on the left are shifted with the animation. |
| 185 // Note that TrayItemView does the same thing. | 182 // Note that TrayItemView does the same thing. |
| 186 gfx::Size size = kTrayItemOuterSize; | 183 gfx::Size size = kTrayItemOuterSize; |
| 187 if (IsHorizontalLayout()) { | 184 if (IsHorizontalLayout()) { |
| 188 size.set_width(std::max( | 185 size.set_width(std::max( |
| 189 1, gfx::ToRoundedInt(size.width() * animation_->GetCurrentValue()))); | 186 1, gfx::ToRoundedInt(size.width() * animation_->GetCurrentValue()))); |
| 190 } else { | 187 } else { |
| 191 size.set_height(std::max( | 188 size.set_height(std::max( |
| 192 1, gfx::ToRoundedInt(size.height() * animation_->GetCurrentValue()))); | 189 1, gfx::ToRoundedInt(size.height() * animation_->GetCurrentValue()))); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 | 665 |
| 669 message_center::MessageCenterBubble* | 666 message_center::MessageCenterBubble* |
| 670 WebNotificationTray::GetMessageCenterBubbleForTest() { | 667 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 671 if (!message_center_bubble()) | 668 if (!message_center_bubble()) |
| 672 return NULL; | 669 return NULL; |
| 673 return static_cast<message_center::MessageCenterBubble*>( | 670 return static_cast<message_center::MessageCenterBubble*>( |
| 674 message_center_bubble()->bubble()); | 671 message_center_bubble()->bubble()); |
| 675 } | 672 } |
| 676 | 673 |
| 677 } // namespace ash | 674 } // namespace ash |
| OLD | NEW |