| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_popup_utils.h" | 5 #include "ash/common/system/tray/tray_popup_utils.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.h" |
| 8 #include "ash/common/ash_view_ids.h" | 8 #include "ash/common/ash_view_ids.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace ash { | 38 namespace ash { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 // Creates a layout manager that positions Views vertically. The Views will be | 42 // Creates a layout manager that positions Views vertically. The Views will be |
| 43 // stretched horizontally and centered vertically. | 43 // stretched horizontally and centered vertically. |
| 44 std::unique_ptr<views::LayoutManager> CreateDefaultCenterLayoutManager() { | 44 std::unique_ptr<views::LayoutManager> CreateDefaultCenterLayoutManager() { |
| 45 // TODO(bruthig): Use constants instead of magic numbers. | 45 // TODO(bruthig): Use constants instead of magic numbers. |
| 46 auto box_layout = | 46 auto box_layout = |
| 47 base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 4, 8, 4); | 47 base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 4, 8, 0); |
| 48 box_layout->set_main_axis_alignment( | 48 box_layout->set_main_axis_alignment( |
| 49 views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); | 49 views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); |
| 50 box_layout->set_cross_axis_alignment( | 50 box_layout->set_cross_axis_alignment( |
| 51 views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH); | 51 views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH); |
| 52 return std::move(box_layout); | 52 return std::move(box_layout); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Creates a layout manager that positions Views horizontally. The Views will be | 55 // Creates a layout manager that positions Views horizontally. The Views will be |
| 56 // centered along the horizontal and vertical axis. | 56 // centered along the horizontal and vertical axis. |
| 57 std::unique_ptr<views::LayoutManager> CreateDefaultEndsLayoutManager() { | 57 std::unique_ptr<views::LayoutManager> CreateDefaultEndsLayoutManager() { |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { | 430 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { |
| 431 // TODO(tdanderson): Consider moving this into WmShell, or introduce a | 431 // TODO(tdanderson): Consider moving this into WmShell, or introduce a |
| 432 // CanShowSettings() method in each delegate type that has a | 432 // CanShowSettings() method in each delegate type that has a |
| 433 // ShowSettings() method. | 433 // ShowSettings() method. |
| 434 return status != LoginStatus::NOT_LOGGED_IN && | 434 return status != LoginStatus::NOT_LOGGED_IN && |
| 435 status != LoginStatus::LOCKED && | 435 status != LoginStatus::LOCKED && |
| 436 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 436 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
| 437 } | 437 } |
| 438 | 438 |
| 439 } // namespace ash | 439 } // namespace ash |
| OLD | NEW |