| 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 "chrome/browser/ui/webui/options/chromeos/power_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/power_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_SOURCE_AC_ADAPTER)); | 88 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_SOURCE_AC_ADAPTER)); |
| 89 localized_strings->SetString( | 89 localized_strings->SetString( |
| 90 "powerSourceLowPowerCharger", | 90 "powerSourceLowPowerCharger", |
| 91 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_SOURCE_LOW_POWER_CHARGER)); | 91 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_SOURCE_LOW_POWER_CHARGER)); |
| 92 localized_strings->SetString( | 92 localized_strings->SetString( |
| 93 "chargingDevices", | 93 "chargingDevices", |
| 94 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_OVERLAY_CHARGING_DEVICES)); | 94 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_OVERLAY_CHARGING_DEVICES)); |
| 95 localized_strings->SetString( | 95 localized_strings->SetString( |
| 96 "calculatingPower", | 96 "calculatingPower", |
| 97 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_OVERLAY_CALCULATING)); | 97 l10n_util::GetStringUTF16(IDS_OPTIONS_POWER_OVERLAY_CALCULATING)); |
| 98 | |
| 99 localized_strings->SetInteger("powerSourceCharger", | |
| 100 PowerStatus::DEDICATED_CHARGER); | |
| 101 localized_strings->SetInteger("powerSourceDualRole", | |
| 102 PowerStatus::DUAL_ROLE_USB); | |
| 103 } | 98 } |
| 104 | 99 |
| 105 void PowerHandler::InitializePage() { | 100 void PowerHandler::InitializePage() { |
| 106 if (this->show_power_status_) | 101 if (this->show_power_status_) |
| 107 PowerStatus::Get()->RequestStatusUpdate(); | 102 PowerStatus::Get()->RequestStatusUpdate(); |
| 108 } | 103 } |
| 109 | 104 |
| 110 void PowerHandler::RegisterMessages() { | 105 void PowerHandler::RegisterMessages() { |
| 111 if (this->show_power_status_) | 106 if (this->show_power_status_) |
| 112 PowerStatus::Get()->AddObserver(this); | 107 PowerStatus::Get()->AddObserver(this); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 web_ui()->CallJavascriptFunction( | 186 web_ui()->CallJavascriptFunction( |
| 192 "options.PowerOverlay.setPowerSources", | 187 "options.PowerOverlay.setPowerSources", |
| 193 sources_list, | 188 sources_list, |
| 194 base::StringValue(status->GetCurrentPowerSourceID()), | 189 base::StringValue(status->GetCurrentPowerSourceID()), |
| 195 base::FundamentalValue(status->IsUsbChargerConnected()), | 190 base::FundamentalValue(status->IsUsbChargerConnected()), |
| 196 base::FundamentalValue(status->IsBatteryTimeBeingCalculated())); | 191 base::FundamentalValue(status->IsBatteryTimeBeingCalculated())); |
| 197 } | 192 } |
| 198 | 193 |
| 199 } // namespace options | 194 } // namespace options |
| 200 } // namespace chromeos | 195 } // namespace chromeos |
| OLD | NEW |