| 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/common/system/chromeos/session/tray_session_length_limit.h" | 5 #include "ash/common/system/chromeos/session/tray_session_length_limit.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // with 1000ms). | 37 // with 1000ms). |
| 38 const int kTimerIntervalInMilliseconds = 500; | 38 const int kTimerIntervalInMilliseconds = 500; |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 const char TraySessionLengthLimit::kNotificationId[] = | 43 const char TraySessionLengthLimit::kNotificationId[] = |
| 44 "chrome://session/timeout"; | 44 "chrome://session/timeout"; |
| 45 | 45 |
| 46 TraySessionLengthLimit::TraySessionLengthLimit(SystemTray* system_tray) | 46 TraySessionLengthLimit::TraySessionLengthLimit(SystemTray* system_tray) |
| 47 : SystemTrayItem(system_tray), | 47 : SystemTrayItem(system_tray, SESSION_LENGTH_LIMIT), |
| 48 limit_state_(LIMIT_NONE), | 48 limit_state_(LIMIT_NONE), |
| 49 last_limit_state_(LIMIT_NONE), | 49 last_limit_state_(LIMIT_NONE), |
| 50 tray_bubble_view_(NULL) { | 50 tray_bubble_view_(NULL) { |
| 51 WmShell::Get()->system_tray_notifier()->AddSessionLengthLimitObserver(this); | 51 WmShell::Get()->system_tray_notifier()->AddSessionLengthLimitObserver(this); |
| 52 Update(); | 52 Update(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 TraySessionLengthLimit::~TraySessionLengthLimit() { | 55 TraySessionLengthLimit::~TraySessionLengthLimit() { |
| 56 WmShell::Get()->system_tray_notifier()->RemoveSessionLengthLimitObserver( | 56 WmShell::Get()->system_tray_notifier()->RemoveSessionLengthLimitObserver( |
| 57 this); | 57 this); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 base::string16 TraySessionLengthLimit::ComposeTrayBubbleMessage() const { | 188 base::string16 TraySessionLengthLimit::ComposeTrayBubbleMessage() const { |
| 189 return l10n_util::GetStringFUTF16( | 189 return l10n_util::GetStringFUTF16( |
| 190 IDS_ASH_STATUS_TRAY_BUBBLE_SESSION_LENGTH_LIMIT, | 190 IDS_ASH_STATUS_TRAY_BUBBLE_SESSION_LENGTH_LIMIT, |
| 191 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, | 191 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, |
| 192 ui::TimeFormat::LENGTH_LONG, 10, | 192 ui::TimeFormat::LENGTH_LONG, 10, |
| 193 remaining_session_time_)); | 193 remaining_session_time_)); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace ash | 196 } // namespace ash |
| OLD | NEW |