| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/low_battery_observer.h" | 5 #include "chrome/browser/chromeos/low_battery_observer.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/common/time_format.h" | 9 #include "chrome/common/time_format.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 } else { | 66 } else { |
| 67 if (!line_power && remaining_minutes <= limit_min) { | 67 if (!line_power && remaining_minutes <= limit_min) { |
| 68 Show(remaining, urgent); | 68 Show(remaining, urgent); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 void LowBatteryObserver::Show(base::TimeDelta remaining, bool urgent) { | 73 void LowBatteryObserver::Show(base::TimeDelta remaining, bool urgent) { |
| 74 notification_.Show(l10n_util::GetStringFUTF16(IDS_LOW_BATTERY_MESSAGE, | 74 notification_.Show(l10n_util::GetStringFUTF16(IDS_LOW_BATTERY_MESSAGE, |
| 75 WideToUTF16(TimeFormat::TimeRemaining(remaining))), urgent); | 75 TimeFormat::TimeRemaining(remaining)), urgent); |
| 76 remaining_ = remaining.InMinutes(); | 76 remaining_ = remaining.InMinutes(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void LowBatteryObserver::Hide() { | 79 void LowBatteryObserver::Hide() { |
| 80 notification_.Hide(); | 80 notification_.Hide(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace chromeos | 83 } // namespace chromeos |
| 84 | 84 |
| OLD | NEW |