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

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

Issue 2821363002: cros: Disable system tray help/lock buttons during supervised user creation (Closed)
Patch Set: fix browser test Created 3 years, 8 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/system/tray/tray_popup_utils.h ('k') | ash/system/tray_accessibility.h » ('j') | 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/system/tray/tray_popup_utils.h" 5 #include "ash/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/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 420 }
421 421
422 views::Separator* TrayPopupUtils::CreateListSubHeaderSeparator() { 422 views::Separator* TrayPopupUtils::CreateListSubHeaderSeparator() {
423 views::Separator* separator = new views::Separator(); 423 views::Separator* separator = new views::Separator();
424 separator->SetColor(kMenuSeparatorColor); 424 separator->SetColor(kMenuSeparatorColor);
425 separator->SetBorder(views::CreateEmptyBorder( 425 separator->SetBorder(views::CreateEmptyBorder(
426 kMenuSeparatorVerticalPadding - views::Separator::kThickness, 0, 0, 0)); 426 kMenuSeparatorVerticalPadding - views::Separator::kThickness, 0, 0, 0));
427 return separator; 427 return separator;
428 } 428 }
429 429
430 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { 430 bool TrayPopupUtils::CanOpenWebUISettings() {
431 // TODO(tdanderson): Consider moving this into ShellPort, or introduce a 431 return Shell::Get()->session_controller()->ShouldEnableSettings();
432 // CanShowSettings() method in each delegate type that has a
433 // ShowSettings() method.
434 return status != LoginStatus::NOT_LOGGED_IN &&
435 status != LoginStatus::LOCKED &&
436 !Shell::Get()->session_controller()->IsInSecondaryLoginScreen();
437 } 432 }
438 433
439 void TrayPopupUtils::InitializeAsCheckableRow(HoverHighlightView* container, 434 void TrayPopupUtils::InitializeAsCheckableRow(HoverHighlightView* container,
440 bool checked) { 435 bool checked) {
441 gfx::ImageSkia check_mark = 436 gfx::ImageSkia check_mark =
442 CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700); 437 CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700);
443 container->AddRightIcon(check_mark, check_mark.width()); 438 container->AddRightIcon(check_mark, check_mark.width());
444 UpdateCheckMarkVisibility(container, checked); 439 UpdateCheckMarkVisibility(container, checked);
445 } 440 }
446 441
447 void TrayPopupUtils::UpdateCheckMarkVisibility(HoverHighlightView* container, 442 void TrayPopupUtils::UpdateCheckMarkVisibility(HoverHighlightView* container,
448 bool visible) { 443 bool visible) {
449 container->SetRightViewVisible(visible); 444 container->SetRightViewVisible(visible);
450 container->SetAccessiblityState( 445 container->SetAccessiblityState(
451 visible ? HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX 446 visible ? HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX
452 : HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); 447 : HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
453 } 448 }
454 449
455 } // namespace ash 450 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_popup_utils.h ('k') | ash/system/tray_accessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698