Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ash/system/overview/overview_button_tray.cc

Issue 2103113003: Fix shelf layout when switching from left-aligned shelf to right-aligned shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/shelf/shelf_constants.h" 9 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/common/shelf/shelf_types.h" 10 #include "ash/common/shelf/shelf_types.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 base::string16 OverviewButtonTray::GetAccessibleNameForTray() { 100 base::string16 OverviewButtonTray::GetAccessibleNameForTray() {
101 return l10n_util::GetStringUTF16(IDS_ASH_OVERVIEW_BUTTON_ACCESSIBLE_NAME); 101 return l10n_util::GetStringUTF16(IDS_ASH_OVERVIEW_BUTTON_ACCESSIBLE_NAME);
102 } 102 }
103 103
104 void OverviewButtonTray::HideBubbleWithView( 104 void OverviewButtonTray::HideBubbleWithView(
105 const views::TrayBubbleView* bubble_view) { 105 const views::TrayBubbleView* bubble_view) {
106 // This class has no bubbles to hide. 106 // This class has no bubbles to hide.
107 } 107 }
108 108
109 void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) { 109 void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment,
110 const gfx::Insets& insets) {
110 if (alignment == shelf_alignment()) 111 if (alignment == shelf_alignment())
111 return; 112 return;
112 113
113 TrayBackgroundView::SetShelfAlignment(alignment); 114 TrayBackgroundView::SetShelfAlignment(alignment, insets);
114 SetIconBorderForShelfAlignment(); 115 SetIconBorderForShelfAlignment();
115 } 116 }
116 117
117 void OverviewButtonTray::SetIconBorderForShelfAlignment() { 118 void OverviewButtonTray::SetIconBorderForShelfAlignment() {
118 if (ash::MaterialDesignController::IsShelfMaterial()) { 119 if (ash::MaterialDesignController::IsShelfMaterial()) {
119 // Pad button size to align with other controls in the system tray. 120 // Pad button size to align with other controls in the system tray.
120 const gfx::ImageSkia image = icon_->GetImage(); 121 const gfx::ImageSkia image = icon_->GetImage();
121 const int vertical_padding = (kTrayItemSize - image.height()) / 2; 122 const int vertical_padding = (kTrayItemSize - image.height()) / 2;
122 const int horizontal_padding = (kTrayItemSize - image.width()) / 2; 123 const int horizontal_padding = (kTrayItemSize - image.width()) / 2;
123 icon_->SetBorder(views::Border::CreateEmptyBorder( 124 icon_->SetBorder(views::Border::CreateEmptyBorder(
(...skipping 24 matching lines...) Expand all
148 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && 149 shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() &&
149 session_state_delegate->IsActiveUserSessionStarted() && 150 session_state_delegate->IsActiveUserSessionStarted() &&
150 !session_state_delegate->IsScreenLocked() && 151 !session_state_delegate->IsScreenLocked() &&
151 session_state_delegate->GetSessionState() == 152 session_state_delegate->GetSessionState() ==
152 SessionStateDelegate::SESSION_STATE_ACTIVE && 153 SessionStateDelegate::SESSION_STATE_ACTIVE &&
153 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != 154 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() !=
154 LoginStatus::KIOSK_APP); 155 LoginStatus::KIOSK_APP);
155 } 156 }
156 157
157 } // namespace ash 158 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698