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

Side by Side Diff: ash/common/system/tray/tray_popup_utils.cc

Issue 2698213004: Start removing some pre-md constants and related code. (Closed)
Patch Set: actually use the constant Created 3 years, 10 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
« no previous file with comments | « ash/common/system/tray/tray_details_view_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/system/tray/tray_popup_utils.h" 5 #include "ash/common/system/tray/tray_popup_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/ash_constants.h" 10 #include "ash/common/ash_constants.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 CreateDefaultLayoutManager(TriView::Container::CENTER)); 166 CreateDefaultLayoutManager(TriView::Container::CENTER));
167 tri_view->SetContainerLayout( 167 tri_view->SetContainerLayout(
168 TriView::Container::END, 168 TriView::Container::END,
169 CreateDefaultLayoutManager(TriView::Container::END)); 169 CreateDefaultLayoutManager(TriView::Container::END));
170 170
171 return tri_view; 171 return tri_view;
172 } 172 }
173 173
174 TriView* TrayPopupUtils::CreateSubHeaderRowView() { 174 TriView* TrayPopupUtils::CreateSubHeaderRowView() {
175 TriView* tri_view = CreateMultiTargetRowView(); 175 TriView* tri_view = CreateMultiTargetRowView();
176 tri_view->SetInsets( 176 tri_view->SetInsets(gfx::Insets(0, kTrayPopupPaddingHorizontal, 0, 0));
177 gfx::Insets(0, kTrayPopupPaddingHorizontal, 0,
178 GetTrayConstant(TRAY_POPUP_ITEM_RIGHT_INSET)));
179 tri_view->SetContainerVisible(TriView::Container::START, false); 177 tri_view->SetContainerVisible(TriView::Container::START, false);
180 tri_view->SetContainerLayout( 178 tri_view->SetContainerLayout(
181 TriView::Container::END, 179 TriView::Container::END,
182 CreateDefaultLayoutManager(TriView::Container::END)); 180 CreateDefaultLayoutManager(TriView::Container::END));
183 return tri_view; 181 return tri_view;
184 } 182 }
185 183
186 TriView* TrayPopupUtils::CreateMultiTargetRowView() { 184 TriView* TrayPopupUtils::CreateMultiTargetRowView() {
187 TriView* tri_view = new TriView(0 /* padding_between_items */); 185 TriView* tri_view = new TriView(0 /* padding_between_items */);
188 186
189 tri_view->SetInsets( 187 tri_view->SetInsets(
190 gfx::Insets(0, GetTrayConstant(TRAY_POPUP_ITEM_LEFT_INSET), 0, 188 gfx::Insets(0, GetTrayConstant(TRAY_POPUP_ITEM_LEFT_INSET), 0, 0));
191 GetTrayConstant(TRAY_POPUP_ITEM_RIGHT_INSET)));
192 189
193 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::START); 190 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::START);
194 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::CENTER); 191 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::CENTER);
195 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::END); 192 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::END);
196 193
197 tri_view->SetContainerLayout(TriView::Container::START, 194 tri_view->SetContainerLayout(TriView::Container::START,
198 base::MakeUnique<views::FillLayout>()); 195 base::MakeUnique<views::FillLayout>());
199 tri_view->SetContainerLayout(TriView::Container::CENTER, 196 tri_view->SetContainerLayout(TriView::Container::CENTER,
200 base::MakeUnique<views::FillLayout>()); 197 base::MakeUnique<views::FillLayout>());
201 tri_view->SetContainerLayout(TriView::Container::END, 198 tri_view->SetContainerLayout(TriView::Container::END,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { 435 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) {
439 // TODO(tdanderson): Consider moving this into WmShell, or introduce a 436 // TODO(tdanderson): Consider moving this into WmShell, or introduce a
440 // CanShowSettings() method in each delegate type that has a 437 // CanShowSettings() method in each delegate type that has a
441 // ShowSettings() method. 438 // ShowSettings() method.
442 return status != LoginStatus::NOT_LOGGED_IN && 439 return status != LoginStatus::NOT_LOGGED_IN &&
443 status != LoginStatus::LOCKED && 440 status != LoginStatus::LOCKED &&
444 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); 441 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen();
445 } 442 }
446 443
447 } // namespace ash 444 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_details_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698