| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/overview/overview_button_tray.h" | 5 #include "ash/system/overview/overview_button_tray.h" |
| 6 | 6 |
| 7 #include "ash/session/session_state_delegate.h" | 7 #include "ash/session/session_state_delegate.h" |
| 8 #include "ash/shelf/shelf_types.h" | 8 #include "ash/shelf/shelf_types.h" |
| 9 #include "ash/shelf/shelf_util.h" | 9 #include "ash/shelf/shelf_util.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
| 12 #include "ash/system/tray/tray_utils.h" | 12 #include "ash/system/tray/tray_utils.h" |
| 13 #include "ash/wm/common/shelf/wm_shelf_util.h" |
| 13 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 14 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 14 #include "ash/wm/overview/window_selector_controller.h" | 15 #include "ash/wm/overview/window_selector_controller.h" |
| 15 #include "grit/ash_resources.h" | 16 #include "grit/ash_resources.h" |
| 16 #include "grit/ash_strings.h" | 17 #include "grit/ash_strings.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/views/border.h" | 20 #include "ui/views/border.h" |
| 20 #include "ui/views/controls/image_view.h" | 21 #include "ui/views/controls/image_view.h" |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 98 |
| 98 void OverviewButtonTray::SetShelfAlignment(wm::ShelfAlignment alignment) { | 99 void OverviewButtonTray::SetShelfAlignment(wm::ShelfAlignment alignment) { |
| 99 if (alignment == shelf_alignment()) | 100 if (alignment == shelf_alignment()) |
| 100 return; | 101 return; |
| 101 | 102 |
| 102 TrayBackgroundView::SetShelfAlignment(alignment); | 103 TrayBackgroundView::SetShelfAlignment(alignment); |
| 103 SetIconBorderForShelfAlignment(); | 104 SetIconBorderForShelfAlignment(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 void OverviewButtonTray::SetIconBorderForShelfAlignment() { | 107 void OverviewButtonTray::SetIconBorderForShelfAlignment() { |
| 107 if (IsHorizontalAlignment(shelf_alignment())) { | 108 if (wm::IsHorizontalAlignment(shelf_alignment())) { |
| 108 icon_->SetBorder(views::Border::CreateEmptyBorder( | 109 icon_->SetBorder(views::Border::CreateEmptyBorder( |
| 109 kHorizontalShelfVerticalPadding, | 110 kHorizontalShelfVerticalPadding, |
| 110 kHorizontalShelfHorizontalPadding, | 111 kHorizontalShelfHorizontalPadding, |
| 111 kHorizontalShelfVerticalPadding, | 112 kHorizontalShelfVerticalPadding, |
| 112 kHorizontalShelfHorizontalPadding)); | 113 kHorizontalShelfHorizontalPadding)); |
| 113 } else { | 114 } else { |
| 114 icon_->SetBorder(views::Border::CreateEmptyBorder( | 115 icon_->SetBorder(views::Border::CreateEmptyBorder( |
| 115 kVerticalShelfVerticalPadding, | 116 kVerticalShelfVerticalPadding, |
| 116 kVerticalShelfHorizontalPadding, | 117 kVerticalShelfHorizontalPadding, |
| 117 kVerticalShelfVerticalPadding, | 118 kVerticalShelfVerticalPadding, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 132 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && | 133 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && |
| 133 session_state_delegate->IsActiveUserSessionStarted() && | 134 session_state_delegate->IsActiveUserSessionStarted() && |
| 134 !session_state_delegate->IsScreenLocked() && | 135 !session_state_delegate->IsScreenLocked() && |
| 135 session_state_delegate->GetSessionState() == | 136 session_state_delegate->GetSessionState() == |
| 136 SessionStateDelegate::SESSION_STATE_ACTIVE && | 137 SessionStateDelegate::SESSION_STATE_ACTIVE && |
| 137 shell->system_tray_delegate()->GetUserLoginStatus() != | 138 shell->system_tray_delegate()->GetUserLoginStatus() != |
| 138 user::LOGGED_IN_KIOSK_APP); | 139 user::LOGGED_IN_KIOSK_APP); |
| 139 } | 140 } |
| 140 | 141 |
| 141 } // namespace ash | 142 } // namespace ash |
| OLD | NEW |