| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/settings/tray_settings.h" | 5 #include "ash/common/system/chromeos/settings/tray_settings.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" |
| 7 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/system/chromeos/power/power_status.h" | 9 #include "ash/common/system/chromeos/power/power_status.h" |
| 9 #include "ash/common/system/chromeos/power/power_status_view.h" | 10 #include "ash/common/system/chromeos/power/power_status_view.h" |
| 10 #include "ash/common/system/tray/actionable_view.h" | 11 #include "ash/common/system/tray/actionable_view.h" |
| 11 #include "ash/common/system/tray/fixed_sized_image_view.h" | 12 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 12 #include "ash/common/system/tray/system_tray_controller.h" | 13 #include "ash/common/system/tray/system_tray_controller.h" |
| 13 #include "ash/common/system/tray/system_tray_delegate.h" | 14 #include "ash/common/system/tray/system_tray_delegate.h" |
| 14 #include "ash/common/system/tray/tray_constants.h" | 15 #include "ash/common/system/tray/tray_constants.h" |
| 15 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 SetAccessibleName(text); | 66 SetAccessibleName(text); |
| 66 | 67 |
| 67 power_view_right_align = true; | 68 power_view_right_align = true; |
| 68 } | 69 } |
| 69 | 70 |
| 70 if (PowerStatus::Get()->IsBatteryPresent()) { | 71 if (PowerStatus::Get()->IsBatteryPresent()) { |
| 71 power_status_view_ = new ash::PowerStatusView(power_view_right_align); | 72 power_status_view_ = new ash::PowerStatusView(power_view_right_align); |
| 72 AddChildView(power_status_view_); | 73 AddChildView(power_status_view_); |
| 73 OnPowerStatusChanged(); | 74 OnPowerStatusChanged(); |
| 74 } | 75 } |
| 76 |
| 77 if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
| 78 SetInkDropMode(InkDropHostView::InkDropMode::ON); |
| 75 } | 79 } |
| 76 | 80 |
| 77 ~SettingsDefaultView() override { PowerStatus::Get()->RemoveObserver(this); } | 81 ~SettingsDefaultView() override { PowerStatus::Get()->RemoveObserver(this); } |
| 78 | 82 |
| 79 // Overridden from ash::ActionableView. | 83 // Overridden from ash::ActionableView. |
| 80 bool PerformAction(const ui::Event& event) override { | 84 bool PerformAction(const ui::Event& event) override { |
| 81 if (login_status_ == LoginStatus::NOT_LOGGED_IN || | 85 if (login_status_ == LoginStatus::NOT_LOGGED_IN || |
| 82 login_status_ == LoginStatus::LOCKED || | 86 login_status_ == LoginStatus::LOCKED || |
| 83 WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) { | 87 WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) { |
| 84 return false; | 88 return false; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 166 |
| 163 void TraySettings::DestroyDefaultView() { | 167 void TraySettings::DestroyDefaultView() { |
| 164 default_view_ = nullptr; | 168 default_view_ = nullptr; |
| 165 } | 169 } |
| 166 | 170 |
| 167 void TraySettings::DestroyDetailedView() {} | 171 void TraySettings::DestroyDetailedView() {} |
| 168 | 172 |
| 169 void TraySettings::UpdateAfterLoginStatusChange(LoginStatus status) {} | 173 void TraySettings::UpdateAfterLoginStatusChange(LoginStatus status) {} |
| 170 | 174 |
| 171 } // namespace ash | 175 } // namespace ash |
| OLD | NEW |