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/options/internet_page_view.h" | 5 #include "chrome/browser/chromeos/options/internet_page_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 if (num_buttons > 0) { | 173 if (num_buttons > 0) { |
174 // We only support 2 buttons. | 174 // We only support 2 buttons. |
175 DCHECK_LE(num_buttons, 2); | 175 DCHECK_LE(num_buttons, 2); |
176 | 176 |
177 if (num_buttons == 1) | 177 if (num_buttons == 1) |
178 layout_->SkipColumns(1); | 178 layout_->SkipColumns(1); |
179 | 179 |
180 if (button_flags & FORGET_BUTTON) { | 180 if (button_flags & FORGET_BUTTON) { |
181 views::NativeButton* button = new views::NativeButton(this, | 181 views::NativeButton* button = new views::NativeButton(this, |
182 l10n_util::GetString(IDS_OPTIONS_SETTINGS_FORGET)); | 182 UTF16ToWide(l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_FORGET))); |
183 button->set_tag(id + kButtonIdOffset * FORGET_BUTTON); | 183 button->set_tag(id + kButtonIdOffset * FORGET_BUTTON); |
184 layout_->AddView(button, 1, 2); | 184 layout_->AddView(button, 1, 2); |
185 } | 185 } |
186 | 186 |
187 if (button_flags & DISCONNECT_BUTTON) { | 187 if (button_flags & DISCONNECT_BUTTON) { |
188 views::NativeButton* button = new views::NativeButton(this, | 188 views::NativeButton* button = new views::NativeButton(this, UTF16ToWide( |
189 l10n_util::GetString(IDS_OPTIONS_SETTINGS_DISCONNECT)); | 189 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_DISCONNECT))); |
190 button->set_tag(id + kButtonIdOffset * DISCONNECT_BUTTON); | 190 button->set_tag(id + kButtonIdOffset * DISCONNECT_BUTTON); |
191 layout_->AddView(button, 1, 2); | 191 layout_->AddView(button, 1, 2); |
192 } | 192 } |
193 | 193 |
194 if (button_flags & CONNECT_BUTTON) { | 194 if (button_flags & CONNECT_BUTTON) { |
195 views::NativeButton* button = new views::NativeButton(this, | 195 views::NativeButton* button = new views::NativeButton(this, |
196 l10n_util::GetString(IDS_OPTIONS_SETTINGS_CONNECT)); | 196 UTF16ToWide(l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_CONNECT))); |
197 button->set_tag(id + kButtonIdOffset * CONNECT_BUTTON); | 197 button->set_tag(id + kButtonIdOffset * CONNECT_BUTTON); |
198 layout_->AddView(button, 1, 2); | 198 layout_->AddView(button, 1, 2); |
199 } | 199 } |
200 | 200 |
201 if (button_flags & OPTIONS_BUTTON) { | 201 if (button_flags & OPTIONS_BUTTON) { |
202 views::NativeButton* button = new views::NativeButton(this, | 202 views::NativeButton* button = new views::NativeButton(this, |
203 l10n_util::GetString(IDS_OPTIONS_SETTINGS_OPTIONS)); | 203 UTF16ToWide(l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OPTIONS))); |
204 button->set_tag(id + kButtonIdOffset * OPTIONS_BUTTON); | 204 button->set_tag(id + kButtonIdOffset * OPTIONS_BUTTON); |
205 layout_->AddView(button, 1, 2); | 205 layout_->AddView(button, 1, 2); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 layout_->StartRow(0, quad_column_view_set_id_); | 209 layout_->StartRow(0, quad_column_view_set_id_); |
210 layout_->SkipColumns(1); | 210 layout_->SkipColumns(1); |
211 views::Label* status_label = new views::Label(status); | 211 views::Label* status_label = new views::Label(status); |
212 status_label->SetFont(rb.GetFont(ResourceBundle::SmallFont)); | 212 status_label->SetFont(rb.GetFont(ResourceBundle::SmallFont)); |
213 status_label->SetColor(SK_ColorLTGRAY); | 213 status_label->SetColor(SK_ColorLTGRAY); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void WiredSection::InitSection() { | 247 void WiredSection::InitSection() { |
248 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); | 248 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); |
249 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 249 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
250 | 250 |
251 SkBitmap icon = *rb.GetBitmapNamed(IDR_STATUSBAR_WIRED_BLACK); | 251 SkBitmap icon = *rb.GetBitmapNamed(IDR_STATUSBAR_WIRED_BLACK); |
252 if (!cros->ethernet_connecting() && !cros->ethernet_connected()) { | 252 if (!cros->ethernet_connecting() && !cros->ethernet_connected()) { |
253 icon = NetworkMenu::IconForDisplay(icon, | 253 icon = NetworkMenu::IconForDisplay(icon, |
254 *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_DISCONNECTED)); | 254 *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_DISCONNECTED)); |
255 } | 255 } |
256 | 256 |
257 std::wstring name = | 257 std::wstring name = UTF16ToWide( |
258 l10n_util::GetString(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); | 258 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET)); |
259 | 259 |
260 int s = IDS_STATUSBAR_NETWORK_DEVICE_DISABLED; | 260 int s = IDS_STATUSBAR_NETWORK_DEVICE_DISABLED; |
261 if (cros->ethernet_connecting()) | 261 if (cros->ethernet_connecting()) |
262 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTING; | 262 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTING; |
263 else if (cros->ethernet_connected()) | 263 else if (cros->ethernet_connected()) |
264 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTED; | 264 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTED; |
265 else if (cros->ethernet_enabled()) | 265 else if (cros->ethernet_enabled()) |
266 s = IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED; | 266 s = IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED; |
267 std::wstring status = l10n_util::GetString(s); | 267 std::wstring status = UTF16ToWide(l10n_util::GetStringUTF16(s)); |
268 | 268 |
269 int flags = cros->ethernet_connected() ? OPTIONS_BUTTON : 0; | 269 int flags = cros->ethernet_connected() ? OPTIONS_BUTTON : 0; |
270 bool bold = cros->ethernet_connected() ? true : false; | 270 bool bold = cros->ethernet_connected() ? true : false; |
271 AddNetwork(0, icon, name, bold, status, flags, TYPE_ETHERNET); | 271 AddNetwork(0, icon, name, bold, status, flags, TYPE_ETHERNET); |
272 } | 272 } |
273 | 273 |
274 void WiredSection::ButtonClicked(int button, int connection_type, int id) { | 274 void WiredSection::ButtonClicked(int button, int connection_type, int id) { |
275 // CreateModalPopup(new NetworkConfigView( | 275 // CreateModalPopup(new NetworkConfigView( |
276 // CrosLibrary::Get()->GetNetworkLibrary()->ethernet_network())); | 276 // CrosLibrary::Get()->GetNetworkLibrary()->ethernet_network())); |
277 } | 277 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 void WirelessSection::AddWirelessNetwork(int id, const SkBitmap& icon, | 392 void WirelessSection::AddWirelessNetwork(int id, const SkBitmap& icon, |
393 const std::wstring& name, bool connecting, bool connected, | 393 const std::wstring& name, bool connecting, bool connected, |
394 int connection_type) { | 394 int connection_type) { |
395 bool bold = connecting || connected; | 395 bool bold = connecting || connected; |
396 | 396 |
397 int s = IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED; | 397 int s = IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED; |
398 if (connecting) | 398 if (connecting) |
399 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTING; | 399 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTING; |
400 else if (connected) | 400 else if (connected) |
401 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTED; | 401 s = IDS_STATUSBAR_NETWORK_DEVICE_CONNECTED; |
402 std::wstring status = l10n_util::GetString(s); | 402 std::wstring status = UTF16ToWide(l10n_util::GetStringUTF16(s)); |
403 | 403 |
404 int flags = 0; | 404 int flags = 0; |
405 if (connected) { | 405 if (connected) { |
406 flags |= DISCONNECT_BUTTON | OPTIONS_BUTTON; | 406 flags |= DISCONNECT_BUTTON | OPTIONS_BUTTON; |
407 } else if (!connecting) { | 407 } else if (!connecting) { |
408 flags |= CONNECT_BUTTON; | 408 flags |= CONNECT_BUTTON; |
409 } | 409 } |
410 | 410 |
411 AddNetwork(id, icon, name, bold, status, flags, connection_type); | 411 AddNetwork(id, icon, name, bold, status, flags, connection_type); |
412 } | 412 } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 scroll_view_->SetBounds(GetLocalBounds(false)); | 587 scroll_view_->SetBounds(GetLocalBounds(false)); |
588 scroll_view_->Layout(); | 588 scroll_view_->Layout(); |
589 } | 589 } |
590 | 590 |
591 void InternetPageView::InitControlLayout() { | 591 void InternetPageView::InitControlLayout() { |
592 AddChildView(scroll_view_); | 592 AddChildView(scroll_view_); |
593 scroll_view_->SetContents(contents_view_); | 593 scroll_view_->SetContents(contents_view_); |
594 } | 594 } |
595 | 595 |
596 } // namespace chromeos | 596 } // namespace chromeos |
OLD | NEW |