| 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/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.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" |
| 11 #include "ash/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/system/chromeos/palette/palette_tool.h" | 12 #include "ash/common/system/chromeos/palette/palette_tool.h" |
| 13 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 13 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
| 14 #include "ash/common/system/tray/system_tray_delegate.h" | 14 #include "ash/common/system/tray/system_tray_delegate.h" |
| 15 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 15 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 16 #include "ash/common/system/tray/tray_constants.h" | 16 #include "ash/common/system/tray/tray_constants.h" |
| 17 #include "ash/common/system/tray/tray_popup_header_button.h" | 17 #include "ash/common/system/tray/tray_popup_header_button.h" |
| 18 #include "ash/common/system/view_observer.h" |
| 18 #include "ash/common/wm_lookup.h" | 19 #include "ash/common/wm_lookup.h" |
| 19 #include "ash/common/wm_root_window_controller.h" | 20 #include "ash/common/wm_root_window_controller.h" |
| 20 #include "ash/common/wm_shell.h" | 21 #include "ash/common/wm_shell.h" |
| 21 #include "ash/common/wm_window.h" | 22 #include "ash/common/wm_window.h" |
| 22 #include "base/sys_info.h" | 23 #include "base/sys_info.h" |
| 23 #include "grit/ash_resources.h" | 24 #include "grit/ash_resources.h" |
| 24 #include "grit/ash_strings.h" | 25 #include "grit/ash_strings.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 27 #include "ui/gfx/paint_vector_icon.h" | 28 #include "ui/gfx/paint_vector_icon.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 IDS_ASH_STATUS_TRAY_SHUTDOWN); | 100 IDS_ASH_STATUS_TRAY_SHUTDOWN); |
| 100 settings_button->SetTooltipText( | 101 settings_button->SetTooltipText( |
| 101 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); | 102 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); |
| 102 root->AddChildView(settings_button); | 103 root->AddChildView(settings_button); |
| 103 | 104 |
| 104 return root; | 105 return root; |
| 105 } | 106 } |
| 106 | 107 |
| 107 } // namespace | 108 } // namespace |
| 108 | 109 |
| 109 PaletteTray::PaletteTray(WmShelf* wm_shelf) | 110 PaletteTray::PaletteTray(WmShelf* wm_shelf, ViewObserver* view_observer) |
| 110 : TrayBackgroundView(wm_shelf), | 111 : TrayBackgroundView(wm_shelf, view_observer), |
| 111 palette_tool_manager_(new PaletteToolManager(this)) { | 112 palette_tool_manager_(new PaletteToolManager(this)) { |
| 112 PaletteTool::RegisterToolInstances(palette_tool_manager_.get()); | 113 PaletteTool::RegisterToolInstances(palette_tool_manager_.get()); |
| 113 | 114 |
| 114 SetContentsBackground(); | 115 SetContentsBackground(); |
| 115 | 116 |
| 116 SetLayoutManager(new views::FillLayout()); | 117 SetLayoutManager(new views::FillLayout()); |
| 117 icon_ = new views::ImageView(); | 118 icon_ = new views::ImageView(); |
| 118 UpdateTrayIcon(); | 119 UpdateTrayIcon(); |
| 119 | 120 |
| 120 SetIconBorderForShelfAlignment(); | 121 SetIconBorderForShelfAlignment(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 WmShell::Get()->GetSessionStateDelegate(); | 308 WmShell::Get()->GetSessionStateDelegate(); |
| 308 | 309 |
| 309 SetVisible(!session_state_delegate->IsScreenLocked() && | 310 SetVisible(!session_state_delegate->IsScreenLocked() && |
| 310 session_state_delegate->GetSessionState() == | 311 session_state_delegate->GetSessionState() == |
| 311 SessionStateDelegate::SESSION_STATE_ACTIVE && | 312 SessionStateDelegate::SESSION_STATE_ACTIVE && |
| 312 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 313 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
| 313 LoginStatus::KIOSK_APP); | 314 LoginStatus::KIOSK_APP); |
| 314 } | 315 } |
| 315 | 316 |
| 316 } // namespace ash | 317 } // namespace ash |
| OLD | NEW |