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/system/tray/system_tray_bubble.h" | 5 #include "ash/system/tray/system_tray_bubble.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 Close(); | 218 Close(); |
219 return; | 219 return; |
220 } | 220 } |
221 | 221 |
222 bubble_view_->GetWidget()->GetContentsView()->Layout(); | 222 bubble_view_->GetWidget()->GetContentsView()->Layout(); |
223 // Make sure that the bubble is large enough for the default view. | 223 // Make sure that the bubble is large enough for the default view. |
224 if (bubble_type_ == BUBBLE_TYPE_DEFAULT) { | 224 if (bubble_type_ == BUBBLE_TYPE_DEFAULT) { |
225 bubble_view_->SetMaxHeight(0); // Clear max height limit. | 225 bubble_view_->SetMaxHeight(0); // Clear max height limit. |
226 } | 226 } |
227 | 227 |
228 if (scoped_layer.get()) { | 228 if (scoped_layer) { |
229 // When transitioning from default view to detailed view, animate the new | 229 // When transitioning from default view to detailed view, animate the new |
230 // view (slide in from the right). | 230 // view (slide in from the right). |
231 if (bubble_type == BUBBLE_TYPE_DETAILED) { | 231 if (bubble_type == BUBBLE_TYPE_DETAILED) { |
232 ui::Layer* new_layer = bubble_view_->layer(); | 232 ui::Layer* new_layer = bubble_view_->layer(); |
233 gfx::Rect bounds = new_layer->bounds(); | 233 gfx::Rect bounds = new_layer->bounds(); |
234 gfx::Transform transform; | 234 gfx::Transform transform; |
235 transform.Translate(bounds.width(), 0.0); | 235 transform.Translate(bounds.width(), 0.0); |
236 new_layer->SetTransform(transform); | 236 new_layer->SetTransform(transform); |
237 { | 237 { |
238 ui::ScopedLayerAnimationSettings settings(new_layer->GetAnimator()); | 238 ui::ScopedLayerAnimationSettings settings(new_layer->GetAnimator()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // For default view, draw bottom border for each item, except the last | 362 // For default view, draw bottom border for each item, except the last |
363 // 2 items, which are the bottom header row and the one just above it. | 363 // 2 items, which are the bottom header row and the one just above it. |
364 bubble_view_->AddChildView(new TrayPopupItemContainer( | 364 bubble_view_->AddChildView(new TrayPopupItemContainer( |
365 item_views[i], is_default_bubble, | 365 item_views[i], is_default_bubble, |
366 is_default_bubble && (i < item_views.size() - 2))); | 366 is_default_bubble && (i < item_views.size() - 2))); |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 } // namespace internal | 370 } // namespace internal |
371 } // namespace ash | 371 } // namespace ash |
OLD | NEW |