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/shell.h" | 10 #include "ash/shell.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
11 #include "ash/system/tray/tray_utils.h" | 12 #include "ash/system/tray/tray_utils.h" |
12 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 13 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
13 #include "ash/wm/overview/window_selector_controller.h" | 14 #include "ash/wm/overview/window_selector_controller.h" |
14 #include "grit/ash_resources.h" | 15 #include "grit/ash_resources.h" |
15 #include "grit/ash_strings.h" | 16 #include "grit/ash_strings.h" |
16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
17 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/views/border.h" | 19 #include "ui/views/border.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 101 |
101 void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) { | 102 void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) { |
102 if (alignment == shelf_alignment()) | 103 if (alignment == shelf_alignment()) |
103 return; | 104 return; |
104 | 105 |
105 TrayBackgroundView::SetShelfAlignment(alignment); | 106 TrayBackgroundView::SetShelfAlignment(alignment); |
106 SetIconBorderForShelfAlignment(); | 107 SetIconBorderForShelfAlignment(); |
107 } | 108 } |
108 | 109 |
109 void OverviewButtonTray::SetIconBorderForShelfAlignment() { | 110 void OverviewButtonTray::SetIconBorderForShelfAlignment() { |
110 if (shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) { | 111 if (IsHorizontalAlignment(shelf_alignment())) { |
111 icon_->SetBorder(views::Border::CreateEmptyBorder( | 112 icon_->SetBorder(views::Border::CreateEmptyBorder( |
112 kHorizontalShelfVerticalPadding, | 113 kHorizontalShelfVerticalPadding, |
113 kHorizontalShelfHorizontalPadding, | 114 kHorizontalShelfHorizontalPadding, |
114 kHorizontalShelfVerticalPadding, | 115 kHorizontalShelfVerticalPadding, |
115 kHorizontalShelfHorizontalPadding)); | 116 kHorizontalShelfHorizontalPadding)); |
116 } else { | 117 } else { |
117 icon_->SetBorder(views::Border::CreateEmptyBorder( | 118 icon_->SetBorder(views::Border::CreateEmptyBorder( |
118 kVerticalShelfVerticalPadding, | 119 kVerticalShelfVerticalPadding, |
119 kVerticalShelfHorizontalPadding, | 120 kVerticalShelfHorizontalPadding, |
120 kVerticalShelfVerticalPadding, | 121 kVerticalShelfVerticalPadding, |
(...skipping 14 matching lines...) Expand all Loading... |
135 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && | 136 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && |
136 session_state_delegate->IsActiveUserSessionStarted() && | 137 session_state_delegate->IsActiveUserSessionStarted() && |
137 !session_state_delegate->IsScreenLocked() && | 138 !session_state_delegate->IsScreenLocked() && |
138 session_state_delegate->GetSessionState() == | 139 session_state_delegate->GetSessionState() == |
139 SessionStateDelegate::SESSION_STATE_ACTIVE && | 140 SessionStateDelegate::SESSION_STATE_ACTIVE && |
140 shell->system_tray_delegate()->GetUserLoginStatus() != | 141 shell->system_tray_delegate()->GetUserLoginStatus() != |
141 user::LOGGED_IN_KIOSK_APP); | 142 user::LOGGED_IN_KIOSK_APP); |
142 } | 143 } |
143 | 144 |
144 } // namespace ash | 145 } // namespace ash |
OLD | NEW |