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

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

Issue 2530763002: [ash-md] Adjusts layout of lists with sticky header rows to match specs (Closed)
Patch Set: [ash-md] Adjusts layout of lists with sticky header rows to match specs (factory) Created 4 years 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 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 "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/ash_view_ids.h" 8 #include "ash/common/ash_view_ids.h"
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 tri_view->SetContainerLayout( 181 tri_view->SetContainerLayout(
182 TriView::Container::CENTER, 182 TriView::Container::CENTER,
183 CreateDefaultLayoutManager(TriView::Container::CENTER)); 183 CreateDefaultLayoutManager(TriView::Container::CENTER));
184 tri_view->SetContainerLayout( 184 tri_view->SetContainerLayout(
185 TriView::Container::END, 185 TriView::Container::END,
186 CreateDefaultLayoutManager(TriView::Container::END)); 186 CreateDefaultLayoutManager(TriView::Container::END));
187 187
188 return tri_view; 188 return tri_view;
189 } 189 }
190 190
191 TriView* TrayPopupUtils::CreateSubHeaderRowView() {
192 TriView* tri_view = CreateMultiTargetRowView();
193 tri_view->SetInsets(
194 gfx::Insets(0, 0, 0, GetTrayConstant(TRAY_POPUP_ITEM_RIGHT_INSET)));
195 tri_view->SetContainerVisible(TriView::Container::START, false);
196 return tri_view;
197 }
198
191 TriView* TrayPopupUtils::CreateMultiTargetRowView() { 199 TriView* TrayPopupUtils::CreateMultiTargetRowView() {
192 TriView* tri_view = new TriView(0 /* padding_between_items */); 200 TriView* tri_view = new TriView(0 /* padding_between_items */);
193 201
194 tri_view->SetInsets( 202 tri_view->SetInsets(
195 gfx::Insets(0, GetTrayConstant(TRAY_POPUP_ITEM_LEFT_INSET), 0, 203 gfx::Insets(0, GetTrayConstant(TRAY_POPUP_ITEM_LEFT_INSET), 0,
196 GetTrayConstant(TRAY_POPUP_ITEM_RIGHT_INSET))); 204 GetTrayConstant(TRAY_POPUP_ITEM_RIGHT_INSET)));
197 205
198 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::START); 206 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::START);
199 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::CENTER); 207 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::CENTER);
200 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::END); 208 ConfigureDefaultSizeAndFlex(tri_view, TriView::Container::END);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 separator->SetBorder(views::CreateEmptyBorder( 428 separator->SetBorder(views::CreateEmptyBorder(
421 kMenuSeparatorVerticalPadding - kSeparatorWidth, 429 kMenuSeparatorVerticalPadding - kSeparatorWidth,
422 left_inset 430 left_inset
423 ? kMenuExtraMarginFromLeftEdge + kMenuButtonSize + 431 ? kMenuExtraMarginFromLeftEdge + kMenuButtonSize +
424 kTrayPopupLabelHorizontalPadding 432 kTrayPopupLabelHorizontalPadding
425 : 0, 433 : 0,
426 kMenuSeparatorVerticalPadding, 0)); 434 kMenuSeparatorVerticalPadding, 0));
427 return separator; 435 return separator;
428 } 436 }
429 437
438 views::Separator* TrayPopupUtils::CreateListSubHeaderSeparator() {
439 views::Separator* separator =
440 new views::Separator(views::Separator::HORIZONTAL);
441 separator->SetColor(kHorizontalSeparatorColor);
442 separator->SetPreferredSize(kSeparatorWidth);
443 separator->SetBorder(views::CreateEmptyBorder(
444 kMenuSeparatorVerticalPadding - kSeparatorWidth, 0, 0, 0));
445 return separator;
446 }
447
430 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { 448 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) {
431 // TODO(tdanderson): Consider moving this into WmShell, or introduce a 449 // TODO(tdanderson): Consider moving this into WmShell, or introduce a
432 // CanShowSettings() method in each delegate type that has a 450 // CanShowSettings() method in each delegate type that has a
433 // ShowSettings() method. 451 // ShowSettings() method.
434 return status != LoginStatus::NOT_LOGGED_IN && 452 return status != LoginStatus::NOT_LOGGED_IN &&
435 status != LoginStatus::LOCKED && 453 status != LoginStatus::LOCKED &&
436 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); 454 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen();
437 } 455 }
438 456
439 } // namespace ash 457 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698