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/system/settings/tray_settings.h" | 5 #include "ash/system/settings/tray_settings.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/power/power_status_view.h" | 8 #include "ash/system/power/power_status_view.h" |
9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 virtual ~SettingsDefaultView() {} | 65 virtual ~SettingsDefaultView() {} |
66 | 66 |
67 void UpdatePowerStatus(const PowerSupplyStatus& status) { | 67 void UpdatePowerStatus(const PowerSupplyStatus& status) { |
68 if (power_status_view_) | 68 if (power_status_view_) |
69 power_status_view_->UpdatePowerStatus(status); | 69 power_status_view_->UpdatePowerStatus(status); |
70 } | 70 } |
71 | 71 |
72 // Overridden from ash::internal::ActionableView. | 72 // Overridden from ash::internal::ActionableView. |
73 virtual bool PerformAction(const views::Event& event) OVERRIDE { | 73 virtual bool PerformAction(const ui::Event& event) OVERRIDE { |
74 if (login_status_ == user::LOGGED_IN_NONE || | 74 if (login_status_ == user::LOGGED_IN_NONE || |
75 login_status_ == user::LOGGED_IN_LOCKED) | 75 login_status_ == user::LOGGED_IN_LOCKED) |
76 return false; | 76 return false; |
77 | 77 |
78 ash::Shell::GetInstance()->tray_delegate()->ShowSettings(); | 78 ash::Shell::GetInstance()->tray_delegate()->ShowSettings(); |
79 return true; | 79 return true; |
80 } | 80 } |
81 | 81 |
82 // Overridden from views::View. | 82 // Overridden from views::View. |
83 virtual void Layout() OVERRIDE { | 83 virtual void Layout() OVERRIDE { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 150 } |
151 | 151 |
152 // Overridden from PowerStatusObserver. | 152 // Overridden from PowerStatusObserver. |
153 void TraySettings::OnPowerStatusChanged(const PowerSupplyStatus& status) { | 153 void TraySettings::OnPowerStatusChanged(const PowerSupplyStatus& status) { |
154 if (default_view_) | 154 if (default_view_) |
155 default_view_->UpdatePowerStatus(status); | 155 default_view_->UpdatePowerStatus(status); |
156 } | 156 } |
157 | 157 |
158 } // namespace internal | 158 } // namespace internal |
159 } // namespace ash | 159 } // namespace ash |
OLD | NEW |