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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell_port.h" |
11 #include "ash/system/tray/system_tray.h" | 12 #include "ash/system/tray/system_tray.h" |
12 #include "ash/system/tray/system_tray_delegate.h" | 13 #include "ash/system/tray/system_tray_delegate.h" |
13 #include "ash/system/tray/system_tray_item.h" | 14 #include "ash/system/tray/system_tray_item.h" |
14 #include "ash/system/tray/tray_bubble_wrapper.h" | 15 #include "ash/system/tray/tray_bubble_wrapper.h" |
15 #include "ash/system/tray/tray_constants.h" | 16 #include "ash/system/tray/tray_constants.h" |
16 #include "ash/wm_shell.h" | |
17 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
20 #include "ui/compositor/layer_animation_observer.h" | 20 #include "ui/compositor/layer_animation_observer.h" |
21 #include "ui/compositor/scoped_layer_animation_settings.h" | 21 #include "ui/compositor/scoped_layer_animation_settings.h" |
22 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
23 #include "ui/views/border.h" | 23 #include "ui/views/border.h" |
24 #include "ui/views/layout/box_layout.h" | 24 #include "ui/views/layout/box_layout.h" |
25 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 bubble_view_->SetBottomPadding(kDefaultViewBottomPadding); | 298 bubble_view_->SetBottomPadding(kDefaultViewBottomPadding); |
299 else | 299 else |
300 bubble_view_->SetBottomPadding(0); | 300 bubble_view_->SetBottomPadding(0); |
301 } | 301 } |
302 | 302 |
303 void SystemTrayBubble::CreateItemViews(LoginStatus login_status) { | 303 void SystemTrayBubble::CreateItemViews(LoginStatus login_status) { |
304 tray_item_view_map_.clear(); | 304 tray_item_view_map_.clear(); |
305 | 305 |
306 // If a system modal dialog is present, create the same tray as | 306 // If a system modal dialog is present, create the same tray as |
307 // in locked state. | 307 // in locked state. |
308 if (WmShell::Get()->IsSystemModalWindowOpen() && | 308 if (ShellPort::Get()->IsSystemModalWindowOpen() && |
309 login_status != LoginStatus::NOT_LOGGED_IN) { | 309 login_status != LoginStatus::NOT_LOGGED_IN) { |
310 login_status = LoginStatus::LOCKED; | 310 login_status = LoginStatus::LOCKED; |
311 } | 311 } |
312 | 312 |
313 views::View* focus_view = nullptr; | 313 views::View* focus_view = nullptr; |
314 for (size_t i = 0; i < items_.size(); ++i) { | 314 for (size_t i = 0; i < items_.size(); ++i) { |
315 views::View* item_view = nullptr; | 315 views::View* item_view = nullptr; |
316 switch (bubble_type_) { | 316 switch (bubble_type_) { |
317 case BUBBLE_TYPE_DEFAULT: | 317 case BUBBLE_TYPE_DEFAULT: |
318 item_view = items_[i]->CreateDefaultView(login_status); | 318 item_view = items_[i]->CreateDefaultView(login_status); |
(...skipping 10 matching lines...) Expand all Loading... |
329 } | 329 } |
330 } | 330 } |
331 | 331 |
332 if (focus_view) { | 332 if (focus_view) { |
333 tray_->ActivateBubble(); | 333 tray_->ActivateBubble(); |
334 focus_view->RequestFocus(); | 334 focus_view->RequestFocus(); |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 } // namespace ash | 338 } // namespace ash |
OLD | NEW |