| 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/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 11 #include "ash/common/shelf/wm_shelf_observer.h" |
| 11 #include "ash/common/shelf/wm_shelf_util.h" | 12 #include "ash/common/shelf/wm_shelf_util.h" |
| 12 #include "ash/common/shell_window_ids.h" | 13 #include "ash/common/shell_window_ids.h" |
| 13 #include "ash/common/system/chromeos/palette/palette_tool.h" | 14 #include "ash/common/system/chromeos/palette/palette_tool.h" |
| 14 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 15 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
| 15 #include "ash/common/system/chromeos/palette/palette_utils.h" | 16 #include "ash/common/system/chromeos/palette/palette_utils.h" |
| 16 #include "ash/common/system/tray/system_tray_delegate.h" | 17 #include "ash/common/system/tray/system_tray_delegate.h" |
| 17 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 18 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 18 #include "ash/common/system/tray/tray_constants.h" | 19 #include "ash/common/system/tray/tray_constants.h" |
| 19 #include "ash/common/system/tray/tray_popup_header_button.h" | 20 #include "ash/common/system/tray/tray_popup_header_button.h" |
| 20 #include "ash/common/wm_lookup.h" | 21 #include "ash/common/wm_lookup.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 IDS_ASH_STATUS_TRAY_SHUTDOWN); | 97 IDS_ASH_STATUS_TRAY_SHUTDOWN); |
| 97 settings_button->SetTooltipText( | 98 settings_button->SetTooltipText( |
| 98 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); | 99 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); |
| 99 root->AddChildView(settings_button); | 100 root->AddChildView(settings_button); |
| 100 | 101 |
| 101 return root; | 102 return root; |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace | 105 } // namespace |
| 105 | 106 |
| 106 PaletteTray::PaletteTray(WmShelf* wm_shelf) | 107 PaletteTray::PaletteTray(WmShelf* wm_shelf, WmShelfObserver* wm_shelf_observer) |
| 107 : TrayBackgroundView(wm_shelf), | 108 : TrayBackgroundView(wm_shelf, wm_shelf_observer), |
| 108 palette_tool_manager_(new PaletteToolManager(this)) { | 109 palette_tool_manager_(new PaletteToolManager(this)) { |
| 109 PaletteTool::RegisterToolInstances(palette_tool_manager_.get()); | 110 PaletteTool::RegisterToolInstances(palette_tool_manager_.get()); |
| 110 | 111 |
| 111 SetContentsBackground(); | 112 SetContentsBackground(); |
| 112 | 113 |
| 113 SetLayoutManager(new views::FillLayout()); | 114 SetLayoutManager(new views::FillLayout()); |
| 114 icon_ = new views::ImageView(); | 115 icon_ = new views::ImageView(); |
| 115 UpdateTrayIcon(); | 116 UpdateTrayIcon(); |
| 116 | 117 |
| 117 SetIconBorderForShelfAlignment(); | 118 SetIconBorderForShelfAlignment(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 WmShell::Get()->GetSessionStateDelegate(); | 305 WmShell::Get()->GetSessionStateDelegate(); |
| 305 | 306 |
| 306 SetVisible(!session_state_delegate->IsScreenLocked() && | 307 SetVisible(!session_state_delegate->IsScreenLocked() && |
| 307 session_state_delegate->GetSessionState() == | 308 session_state_delegate->GetSessionState() == |
| 308 SessionStateDelegate::SESSION_STATE_ACTIVE && | 309 SessionStateDelegate::SESSION_STATE_ACTIVE && |
| 309 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 310 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
| 310 LoginStatus::KIOSK_APP); | 311 LoginStatus::KIOSK_APP); |
| 311 } | 312 } |
| 312 | 313 |
| 313 } // namespace ash | 314 } // namespace ash |
| OLD | NEW |