| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/date/date_default_view.h" | 5 #include "ash/system/date/date_default_view.h" |
| 6 | 6 |
| 7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
| 8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/date/date_view.h" | 10 #include "ash/system/date/date_view.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 | 120 |
| 121 tray::DateView* DateDefaultView::GetDateView() { | 121 tray::DateView* DateDefaultView::GetDateView() { |
| 122 return date_view_; | 122 return date_view_; |
| 123 } | 123 } |
| 124 | 124 |
| 125 const tray::DateView* DateDefaultView::GetDateView() const { | 125 const tray::DateView* DateDefaultView::GetDateView() const { |
| 126 return date_view_; | 126 return date_view_; |
| 127 } | 127 } |
| 128 | 128 |
| 129 void DateDefaultView::OnPaint(gfx::Canvas* canvas) { |
| 130 // JAMES: This is triggered by hovering the mouse over the lower-left corner |
| 131 // of the bubble. |
| 132 LOG(ERROR) << "JAMES OnPaint"; |
| 133 views::View::OnPaint(canvas); |
| 134 } |
| 135 |
| 129 void DateDefaultView::ButtonPressed(views::Button* sender, | 136 void DateDefaultView::ButtonPressed(views::Button* sender, |
| 130 const ui::Event& event) { | 137 const ui::Event& event) { |
| 131 ash::Shell* shell = ash::Shell::GetInstance(); | 138 ash::Shell* shell = ash::Shell::GetInstance(); |
| 132 ash::SystemTrayDelegate* tray_delegate = shell->system_tray_delegate(); | 139 ash::SystemTrayDelegate* tray_delegate = shell->system_tray_delegate(); |
| 133 if (sender == help_button_) { | 140 if (sender == help_button_) { |
| 134 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_HELP); | 141 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_HELP); |
| 135 tray_delegate->ShowHelp(); | 142 tray_delegate->ShowHelp(); |
| 136 } else if (sender == shutdown_button_) { | 143 } else if (sender == shutdown_button_) { |
| 137 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN); | 144 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN); |
| 138 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); | 145 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); |
| 139 } else if (sender == lock_button_) { | 146 } else if (sender == lock_button_) { |
| 140 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN); | 147 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN); |
| 141 tray_delegate->RequestLockScreen(); | 148 tray_delegate->RequestLockScreen(); |
| 142 } else { | 149 } else { |
| 143 NOTREACHED(); | 150 NOTREACHED(); |
| 144 } | 151 } |
| 145 } | 152 } |
| 146 | 153 |
| 147 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) { | 154 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) { |
| 148 if (!shutdown_button_) | 155 if (!shutdown_button_) |
| 149 return; | 156 return; |
| 150 | 157 |
| 151 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( | 158 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( |
| 152 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT | 159 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT |
| 153 : IDS_ASH_STATUS_TRAY_SHUTDOWN)); | 160 : IDS_ASH_STATUS_TRAY_SHUTDOWN)); |
| 154 } | 161 } |
| 155 | 162 |
| 156 } // namespace ash | 163 } // namespace ash |
| OLD | NEW |