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/chromeos/palette/palette_tray.h" | 5 #include "ash/common/system/chromeos/palette/palette_tray.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_constants.h" | 7 #include "ash/common/shelf/shelf_constants.h" |
8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "ash/common/shelf/wm_shelf_util.h" | 9 #include "ash/common/shelf/wm_shelf_util.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
11 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 11 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
12 #include "ash/common/system/chromeos/palette/palette_utils.h" | 12 #include "ash/common/system/chromeos/palette/palette_utils.h" |
13 #include "ash/common/system/tray/system_tray_delegate.h" | 13 #include "ash/common/system/tray/system_tray_delegate.h" |
14 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 14 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
15 #include "ash/common/system/tray/tray_constants.h" | 15 #include "ash/common/system/tray/tray_constants.h" |
16 #include "ash/common/system/tray/tray_popup_header_button.h" | 16 #include "ash/common/system/tray/tray_popup_header_button.h" |
17 #include "ash/common/wm_lookup.h" | 17 #include "ash/common/wm_lookup.h" |
18 #include "ash/common/wm_root_window_controller.h" | 18 #include "ash/common/wm_root_window_controller.h" |
19 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
20 #include "ash/common/wm_window.h" | 20 #include "ash/common/wm_window.h" |
| 21 #include "ash/resources/vector_icons/vector_icons.h" |
21 #include "base/metrics/histogram_macros.h" | 22 #include "base/metrics/histogram_macros.h" |
22 #include "grit/ash_resources.h" | 23 #include "grit/ash_resources.h" |
23 #include "grit/ash_strings.h" | 24 #include "grit/ash_strings.h" |
24 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
25 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
26 #include "ui/events/devices/stylus_state.h" | 27 #include "ui/events/devices/stylus_state.h" |
27 #include "ui/gfx/color_palette.h" | 28 #include "ui/gfx/color_palette.h" |
28 #include "ui/gfx/paint_vector_icon.h" | 29 #include "ui/gfx/paint_vector_icon.h" |
29 #include "ui/gfx/vector_icons_public.h" | 30 #include "ui/gfx/vector_icons_public.h" |
30 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); | 79 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); |
79 SetLayoutManager(box_layout); | 80 SetLayoutManager(box_layout); |
80 | 81 |
81 views::Label* text_label = | 82 views::Label* text_label = |
82 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_TITLE)); | 83 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_TITLE)); |
83 text_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 84 text_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
84 text_label->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont)); | 85 text_label->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont)); |
85 AddChildView(text_label); | 86 AddChildView(text_label); |
86 box_layout->SetFlexForView(text_label, 1); | 87 box_layout->SetFlexForView(text_label, 1); |
87 | 88 |
88 gfx::ImageSkia settings_icon = CreateVectorIcon( | 89 gfx::ImageSkia settings_icon = CreateVectorIcon(gfx::VectorIconId::SETTINGS, |
89 gfx::VectorIconId::SETTINGS, kIconSize, gfx::kChromeIconGrey); | 90 kIconSize, kMenuIconColor); |
90 gfx::ImageSkia help_icon = CreateVectorIcon( | 91 gfx::ImageSkia help_icon = |
91 gfx::VectorIconId::HELP, kIconSize, gfx::kChromeIconGrey); | 92 CreateVectorIcon(kSystemMenuHelpIcon, kMenuIconColor); |
| 93 DCHECK_EQ(kIconSize, help_icon.width()); |
92 | 94 |
93 help_button_ = new ash::TrayPopupHeaderButton(this, help_icon, | 95 help_button_ = new ash::TrayPopupHeaderButton(this, help_icon, |
94 IDS_ASH_STATUS_TRAY_HELP); | 96 IDS_ASH_STATUS_TRAY_HELP); |
95 help_button_->SetTooltipText( | 97 help_button_->SetTooltipText( |
96 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_HELP)); | 98 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_HELP)); |
97 AddChildView(help_button_); | 99 AddChildView(help_button_); |
98 | 100 |
99 settings_button_ = new ash::TrayPopupHeaderButton( | 101 settings_button_ = new ash::TrayPopupHeaderButton( |
100 this, settings_icon, IDS_ASH_STATUS_TRAY_SETTINGS); | 102 this, settings_icon, IDS_ASH_STATUS_TRAY_SETTINGS); |
101 settings_button_->SetTooltipText( | 103 settings_button_->SetTooltipText( |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 WmShell::Get()->GetSessionStateDelegate(); | 416 WmShell::Get()->GetSessionStateDelegate(); |
415 | 417 |
416 SetVisible(!session_state_delegate->IsScreenLocked() && | 418 SetVisible(!session_state_delegate->IsScreenLocked() && |
417 session_state_delegate->GetSessionState() == | 419 session_state_delegate->GetSessionState() == |
418 SessionStateDelegate::SESSION_STATE_ACTIVE && | 420 SessionStateDelegate::SESSION_STATE_ACTIVE && |
419 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 421 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
420 LoginStatus::KIOSK_APP); | 422 LoginStatus::KIOSK_APP); |
421 } | 423 } |
422 | 424 |
423 } // namespace ash | 425 } // namespace ash |
OLD | NEW |