| 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/network_config_view.h" | 5 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 NetworkConfigView::NetworkConfigView(const WifiNetwork* wifi) | 25 NetworkConfigView::NetworkConfigView(const WifiNetwork* wifi) |
| 26 : browser_mode_(true), | 26 : browser_mode_(true), |
| 27 title_(ASCIIToWide(wifi->name())), | 27 title_(ASCIIToWide(wifi->name())), |
| 28 wificonfig_view_(new WifiConfigView(this, wifi)), | 28 wificonfig_view_(new WifiConfigView(this, wifi)), |
| 29 delegate_(NULL) { | 29 delegate_(NULL) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 NetworkConfigView::NetworkConfigView() | 32 NetworkConfigView::NetworkConfigView() |
| 33 : browser_mode_(true), | 33 : browser_mode_(true), |
| 34 title_(l10n_util::GetString(IDS_OPTIONS_SETTINGS_OTHER_NETWORKS)), | 34 title_(UTF16ToWide( |
| 35 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_NETWORKS))), |
| 35 wificonfig_view_(new WifiConfigView(this)), | 36 wificonfig_view_(new WifiConfigView(this)), |
| 36 delegate_(NULL) { | 37 delegate_(NULL) { |
| 37 } | 38 } |
| 38 | 39 |
| 39 gfx::NativeWindow NetworkConfigView::GetNativeWindow() const { | 40 gfx::NativeWindow NetworkConfigView::GetNativeWindow() const { |
| 40 return GTK_WINDOW(static_cast<WidgetGtk*>(GetWidget())->GetNativeView()); | 41 return GTK_WINDOW(static_cast<WidgetGtk*>(GetWidget())->GetNativeView()); |
| 41 } | 42 } |
| 42 | 43 |
| 43 std::wstring NetworkConfigView::GetDialogButtonLabel( | 44 std::wstring NetworkConfigView::GetDialogButtonLabel( |
| 44 MessageBoxFlags::DialogButton button) const { | 45 MessageBoxFlags::DialogButton button) const { |
| 45 if (button == MessageBoxFlags::DIALOGBUTTON_OK) | 46 if (button == MessageBoxFlags::DIALOGBUTTON_OK) |
| 46 return l10n_util::GetString(IDS_OPTIONS_SETTINGS_CONNECT); | 47 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_CONNECT)); |
| 47 return std::wstring(); | 48 return std::wstring(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 bool NetworkConfigView::IsDialogButtonEnabled( | 51 bool NetworkConfigView::IsDialogButtonEnabled( |
| 51 MessageBoxFlags::DialogButton button) const { | 52 MessageBoxFlags::DialogButton button) const { |
| 52 // Disable connect button if cannot login. | 53 // Disable connect button if cannot login. |
| 53 if (button == MessageBoxFlags::DIALOGBUTTON_OK) | 54 if (button == MessageBoxFlags::DIALOGBUTTON_OK) |
| 54 return wificonfig_view_->can_login(); | 55 return wificonfig_view_->can_login(); |
| 55 return true; | 56 return true; |
| 56 } | 57 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 89 |
| 89 void NetworkConfigView::ViewHierarchyChanged( | 90 void NetworkConfigView::ViewHierarchyChanged( |
| 90 bool is_add, views::View* parent, views::View* child) { | 91 bool is_add, views::View* parent, views::View* child) { |
| 91 // Can't init before we're inserted into a Container, because we require | 92 // Can't init before we're inserted into a Container, because we require |
| 92 // a HWND to parent native child controls to. | 93 // a HWND to parent native child controls to. |
| 93 if (is_add && child == this) | 94 if (is_add && child == this) |
| 94 AddChildView(wificonfig_view_); | 95 AddChildView(wificonfig_view_); |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace chromeos | 98 } // namespace chromeos |
| OLD | NEW |