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

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

Issue 1929023002: Refactors WindowResizers to use ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698