OLD | NEW |
---|---|
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" |
11 #include "ash/common/ash_view_ids.h" | 11 #include "ash/common/ash_view_ids.h" |
12 #include "ash/common/session/session_controller.h" | 12 #include "ash/common/session/session_controller.h" |
13 #include "ash/common/system/tray/fixed_sized_image_view.h" | 13 #include "ash/common/system/tray/fixed_sized_image_view.h" |
14 #include "ash/common/system/tray/hover_highlight_view.h" | |
14 #include "ash/common/system/tray/size_range_layout.h" | 15 #include "ash/common/system/tray/size_range_layout.h" |
15 #include "ash/common/system/tray/tray_constants.h" | 16 #include "ash/common/system/tray/tray_constants.h" |
16 #include "ash/common/system/tray/tray_popup_item_style.h" | 17 #include "ash/common/system/tray/tray_popup_item_style.h" |
17 #include "ash/resources/vector_icons/vector_icons.h" | 18 #include "ash/resources/vector_icons/vector_icons.h" |
18 #include "ash/shell.h" | 19 #include "ash/shell.h" |
19 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
22 #include "ui/gfx/color_palette.h" | |
21 #include "ui/gfx/paint_vector_icon.h" | 23 #include "ui/gfx/paint_vector_icon.h" |
22 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" | 24 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" |
23 #include "ui/views/animation/ink_drop_highlight.h" | 25 #include "ui/views/animation/ink_drop_highlight.h" |
24 #include "ui/views/animation/ink_drop_impl.h" | 26 #include "ui/views/animation/ink_drop_impl.h" |
25 #include "ui/views/animation/ink_drop_mask.h" | 27 #include "ui/views/animation/ink_drop_mask.h" |
26 #include "ui/views/animation/square_ink_drop_ripple.h" | 28 #include "ui/views/animation/square_ink_drop_ripple.h" |
27 #include "ui/views/background.h" | 29 #include "ui/views/background.h" |
28 #include "ui/views/border.h" | 30 #include "ui/views/border.h" |
29 #include "ui/views/controls/button/button.h" | 31 #include "ui/views/controls/button/button.h" |
30 #include "ui/views/controls/button/label_button.h" | 32 #include "ui/views/controls/button/label_button.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 | 429 |
428 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { | 430 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { |
429 // TODO(tdanderson): Consider moving this into WmShell, or introduce a | 431 // TODO(tdanderson): Consider moving this into WmShell, or introduce a |
430 // CanShowSettings() method in each delegate type that has a | 432 // CanShowSettings() method in each delegate type that has a |
431 // ShowSettings() method. | 433 // ShowSettings() method. |
432 return status != LoginStatus::NOT_LOGGED_IN && | 434 return status != LoginStatus::NOT_LOGGED_IN && |
433 status != LoginStatus::LOCKED && | 435 status != LoginStatus::LOCKED && |
434 !Shell::Get()->session_controller()->IsInSecondaryLoginScreen(); | 436 !Shell::Get()->session_controller()->IsInSecondaryLoginScreen(); |
435 } | 437 } |
436 | 438 |
439 void TrayPopupUtils::UpdateCheckMarkVisibility(HoverHighlightView* container, | |
tdanderson
2017/04/07 17:54:31
What do you think about splitting this into two he
| |
440 bool checked) { | |
441 if (checked) { | |
442 gfx::ImageSkia check_mark = | |
443 CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700); | |
444 container->AddRightIcon(check_mark, check_mark.width()); | |
445 container->SetRightViewVisible(true); | |
446 container->SetAccessiblityState( | |
447 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); | |
448 } else { | |
449 container->SetAccessiblityState( | |
450 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); | |
451 } | |
452 } | |
453 | |
437 } // namespace ash | 454 } // namespace ash |
OLD | NEW |