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/palette_delegate.h" | 7 #include "ash/common/palette_delegate.h" |
8 #include "ash/common/shelf/shelf_constants.h" | 8 #include "ash/common/shelf/shelf_constants.h" |
9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
10 #include "ash/common/shelf/wm_shelf_util.h" | 10 #include "ash/common/shelf/wm_shelf_util.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 explicit TitleView(PaletteTray* palette_tray) : palette_tray_(palette_tray) { | 65 explicit TitleView(PaletteTray* palette_tray) : palette_tray_(palette_tray) { |
66 auto& rb = ui::ResourceBundle::GetSharedInstance(); | 66 auto& rb = ui::ResourceBundle::GetSharedInstance(); |
67 | 67 |
68 auto* box_layout = | 68 auto* box_layout = |
69 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); | 69 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); |
70 SetLayoutManager(box_layout); | 70 SetLayoutManager(box_layout); |
71 SetBorder(views::Border::CreateEmptyBorder( | 71 SetBorder(views::Border::CreateEmptyBorder( |
72 0, ash::kTrayPopupPaddingHorizontal, 0, 0)); | 72 0, ash::kTrayPopupPaddingHorizontal, 0, 0)); |
73 | 73 |
74 views::Label* text_label = | 74 views::Label* text_label = |
75 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_PALETTE_TITLE)); | 75 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_TITLE)); |
76 text_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 76 text_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
77 text_label->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont)); | 77 text_label->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont)); |
78 AddChildView(text_label); | 78 AddChildView(text_label); |
79 box_layout->SetFlexForView(text_label, 1); | 79 box_layout->SetFlexForView(text_label, 1); |
80 | 80 |
81 help_button_ = new ash::TrayPopupHeaderButton(this, IDR_AURA_UBER_TRAY_HELP, | 81 help_button_ = new ash::TrayPopupHeaderButton(this, IDR_AURA_UBER_TRAY_HELP, |
82 IDS_ASH_STATUS_TRAY_HELP); | 82 IDS_ASH_STATUS_TRAY_HELP); |
83 help_button_->SetTooltipText( | 83 help_button_->SetTooltipText( |
84 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); | 84 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_HELP)); |
85 AddChildView(help_button_); | 85 AddChildView(help_button_); |
86 | 86 |
87 AddChildView(CreateSeparator(views::Separator::VERTICAL)); | 87 AddChildView(CreateSeparator(views::Separator::VERTICAL)); |
88 | 88 |
89 settings_button_ = new ash::TrayPopupHeaderButton( | 89 settings_button_ = new ash::TrayPopupHeaderButton( |
90 this, IDR_AURA_UBER_TRAY_SETTINGS, IDS_ASH_STATUS_TRAY_SETTINGS); | 90 this, IDR_AURA_UBER_TRAY_SETTINGS, IDS_ASH_STATUS_TRAY_SETTINGS); |
91 settings_button_->SetTooltipText( | 91 settings_button_->SetTooltipText( |
92 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SETTINGS)); | 92 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SETTINGS)); |
93 AddChildView(settings_button_); | 93 AddChildView(settings_button_); |
94 } | 94 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 void PaletteTray::SessionStateChanged( | 215 void PaletteTray::SessionStateChanged( |
216 SessionStateDelegate::SessionState state) { | 216 SessionStateDelegate::SessionState state) { |
217 UpdateIconVisibility(); | 217 UpdateIconVisibility(); |
218 } | 218 } |
219 | 219 |
220 void PaletteTray::ClickedOutsideBubble() { | 220 void PaletteTray::ClickedOutsideBubble() { |
221 bubble_.reset(); | 221 bubble_.reset(); |
222 } | 222 } |
223 | 223 |
224 base::string16 PaletteTray::GetAccessibleNameForTray() { | 224 base::string16 PaletteTray::GetAccessibleNameForTray() { |
225 return l10n_util::GetStringUTF16(IDS_ASH_PALETTE_TITLE); | 225 return l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_TITLE); |
226 } | 226 } |
227 | 227 |
228 void PaletteTray::HideBubbleWithView(const views::TrayBubbleView* bubble_view) { | 228 void PaletteTray::HideBubbleWithView(const views::TrayBubbleView* bubble_view) { |
229 if (bubble_->bubble_view() == bubble_view) | 229 if (bubble_->bubble_view() == bubble_view) |
230 bubble_.reset(); | 230 bubble_.reset(); |
231 } | 231 } |
232 | 232 |
233 void PaletteTray::BubbleViewDestroyed() { | 233 void PaletteTray::BubbleViewDestroyed() { |
234 palette_tool_manager_->NotifyViewsDestroyed(); | 234 palette_tool_manager_->NotifyViewsDestroyed(); |
235 SetDrawBackgroundAsActive(false); | 235 SetDrawBackgroundAsActive(false); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 WmShell::Get()->GetSessionStateDelegate(); | 341 WmShell::Get()->GetSessionStateDelegate(); |
342 | 342 |
343 SetVisible(!session_state_delegate->IsScreenLocked() && | 343 SetVisible(!session_state_delegate->IsScreenLocked() && |
344 session_state_delegate->GetSessionState() == | 344 session_state_delegate->GetSessionState() == |
345 SessionStateDelegate::SESSION_STATE_ACTIVE && | 345 SessionStateDelegate::SESSION_STATE_ACTIVE && |
346 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 346 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
347 LoginStatus::KIOSK_APP); | 347 LoginStatus::KIOSK_APP); |
348 } | 348 } |
349 | 349 |
350 } // namespace ash | 350 } // namespace ash |
OLD | NEW |