| 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/system_tray_bubble.h" | 5 #include "ash/common/system/tray/system_tray_bubble.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| 11 #include "ash/common/system/tray/system_tray_delegate.h" | 11 #include "ash/common/system/tray/system_tray_delegate.h" |
| 12 #include "ash/common/system/tray/system_tray_item.h" | 12 #include "ash/common/system/tray/system_tray_item.h" |
| 13 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 13 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 14 #include "ash/common/system/tray/tray_constants.h" | 14 #include "ash/common/system/tray/tray_constants.h" |
| 15 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
| 16 #include "ash/shell.h" |
| 16 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
| 17 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
| 18 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
| 19 #include "ui/compositor/layer_animation_observer.h" | 20 #include "ui/compositor/layer_animation_observer.h" |
| 20 #include "ui/compositor/scoped_layer_animation_settings.h" | 21 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 21 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
| 22 #include "ui/views/border.h" | 23 #include "ui/views/border.h" |
| 23 #include "ui/views/layout/box_layout.h" | 24 #include "ui/views/layout/box_layout.h" |
| 24 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
| 25 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 shadow->SetOpacity(0.15f); | 135 shadow->SetOpacity(0.15f); |
| 135 } | 136 } |
| 136 } | 137 } |
| 137 } | 138 } |
| 138 | 139 |
| 139 DestroyItemViews(); | 140 DestroyItemViews(); |
| 140 bubble_view_->RemoveAllChildViews(true); | 141 bubble_view_->RemoveAllChildViews(true); |
| 141 | 142 |
| 142 items_ = items; | 143 items_ = items; |
| 143 bubble_type_ = bubble_type; | 144 bubble_type_ = bubble_type; |
| 144 CreateItemViews(WmShell::Get()->system_tray_delegate()->GetUserLoginStatus()); | 145 CreateItemViews(Shell::Get()->system_tray_delegate()->GetUserLoginStatus()); |
| 145 | 146 |
| 146 // Close bubble view if we failed to create the item view. | 147 // Close bubble view if we failed to create the item view. |
| 147 if (!bubble_view_->has_children()) { | 148 if (!bubble_view_->has_children()) { |
| 148 Close(); | 149 Close(); |
| 149 return; | 150 return; |
| 150 } | 151 } |
| 151 | 152 |
| 152 UpdateBottomPadding(); | 153 UpdateBottomPadding(); |
| 153 bubble_view_->GetWidget()->GetContentsView()->Layout(); | 154 bubble_view_->GetWidget()->GetContentsView()->Layout(); |
| 154 // Make sure that the bubble is large enough for the default view. | 155 // Make sure that the bubble is large enough for the default view. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 329 } |
| 329 } | 330 } |
| 330 | 331 |
| 331 if (focus_view) { | 332 if (focus_view) { |
| 332 tray_->ActivateBubble(); | 333 tray_->ActivateBubble(); |
| 333 focus_view->RequestFocus(); | 334 focus_view->RequestFocus(); |
| 334 } | 335 } |
| 335 } | 336 } |
| 336 | 337 |
| 337 } // namespace ash | 338 } // namespace ash |
| OLD | NEW |