| 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/common/wm/shelf/wm_shelf_util.h" | 7 #include "ash/common/shelf/shelf_types.h" |
| 8 #include "ash/common/shelf/wm_shelf_util.h" |
| 8 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
| 9 #include "ash/shelf/shelf_types.h" | |
| 10 #include "ash/shelf/shelf_util.h" | 10 #include "ash/shelf/shelf_util.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/system/tray/system_tray_delegate.h" | 12 #include "ash/system/tray/system_tray_delegate.h" |
| 13 #include "ash/system/tray/tray_utils.h" | 13 #include "ash/system/tray/tray_utils.h" |
| 14 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 14 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 15 #include "ash/wm/overview/window_selector_controller.h" | 15 #include "ash/wm/overview/window_selector_controller.h" |
| 16 #include "grit/ash_resources.h" | 16 #include "grit/ash_resources.h" |
| 17 #include "grit/ash_strings.h" | 17 #include "grit/ash_strings.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 base::string16 OverviewButtonTray::GetAccessibleNameForTray() { | 90 base::string16 OverviewButtonTray::GetAccessibleNameForTray() { |
| 91 return l10n_util::GetStringUTF16(IDS_ASH_OVERVIEW_BUTTON_ACCESSIBLE_NAME); | 91 return l10n_util::GetStringUTF16(IDS_ASH_OVERVIEW_BUTTON_ACCESSIBLE_NAME); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void OverviewButtonTray::HideBubbleWithView( | 94 void OverviewButtonTray::HideBubbleWithView( |
| 95 const views::TrayBubbleView* bubble_view) { | 95 const views::TrayBubbleView* bubble_view) { |
| 96 // This class has no bubbles to hide. | 96 // This class has no bubbles to hide. |
| 97 } | 97 } |
| 98 | 98 |
| 99 void OverviewButtonTray::SetShelfAlignment(wm::ShelfAlignment alignment) { | 99 void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) { |
| 100 if (alignment == shelf_alignment()) | 100 if (alignment == shelf_alignment()) |
| 101 return; | 101 return; |
| 102 | 102 |
| 103 TrayBackgroundView::SetShelfAlignment(alignment); | 103 TrayBackgroundView::SetShelfAlignment(alignment); |
| 104 SetIconBorderForShelfAlignment(); | 104 SetIconBorderForShelfAlignment(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void OverviewButtonTray::SetIconBorderForShelfAlignment() { | 107 void OverviewButtonTray::SetIconBorderForShelfAlignment() { |
| 108 if (wm::IsHorizontalAlignment(shelf_alignment())) { | 108 if (IsHorizontalAlignment(shelf_alignment())) { |
| 109 icon_->SetBorder(views::Border::CreateEmptyBorder( | 109 icon_->SetBorder(views::Border::CreateEmptyBorder( |
| 110 kHorizontalShelfVerticalPadding, | 110 kHorizontalShelfVerticalPadding, |
| 111 kHorizontalShelfHorizontalPadding, | 111 kHorizontalShelfHorizontalPadding, |
| 112 kHorizontalShelfVerticalPadding, | 112 kHorizontalShelfVerticalPadding, |
| 113 kHorizontalShelfHorizontalPadding)); | 113 kHorizontalShelfHorizontalPadding)); |
| 114 } else { | 114 } else { |
| 115 icon_->SetBorder(views::Border::CreateEmptyBorder( | 115 icon_->SetBorder(views::Border::CreateEmptyBorder( |
| 116 kVerticalShelfVerticalPadding, | 116 kVerticalShelfVerticalPadding, |
| 117 kVerticalShelfHorizontalPadding, | 117 kVerticalShelfHorizontalPadding, |
| 118 kVerticalShelfVerticalPadding, | 118 kVerticalShelfVerticalPadding, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 133 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && | 133 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && |
| 134 session_state_delegate->IsActiveUserSessionStarted() && | 134 session_state_delegate->IsActiveUserSessionStarted() && |
| 135 !session_state_delegate->IsScreenLocked() && | 135 !session_state_delegate->IsScreenLocked() && |
| 136 session_state_delegate->GetSessionState() == | 136 session_state_delegate->GetSessionState() == |
| 137 SessionStateDelegate::SESSION_STATE_ACTIVE && | 137 SessionStateDelegate::SESSION_STATE_ACTIVE && |
| 138 shell->system_tray_delegate()->GetUserLoginStatus() != | 138 shell->system_tray_delegate()->GetUserLoginStatus() != |
| 139 user::LOGGED_IN_KIOSK_APP); | 139 user::LOGGED_IN_KIOSK_APP); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace ash | 142 } // namespace ash |
| OLD | NEW |