| 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/login/network_selection_view.h" | 5 #include "chrome/browser/chromeos/login/network_selection_view.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
| 12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/chromeos/login/helper.h" | 14 #include "chrome/browser/chromeos/login/helper.h" |
| 15 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 15 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
| 16 #include "chrome/browser/chromeos/login/network_screen_delegate.h" | 16 #include "chrome/browser/chromeos/login/network_screen_delegate.h" |
| 17 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 17 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
| 18 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
| 18 #include "chrome/browser/chromeos/status/network_dropdown_button.h" | 19 #include "chrome/browser/chromeos/status/network_dropdown_button.h" |
| 19 #include "gfx/size.h" | 20 #include "gfx/size.h" |
| 20 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
| 21 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 22 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
| 23 #include "views/controls/button/native_button.h" | 24 #include "views/controls/button/native_button.h" |
| 24 #include "views/controls/label.h" | 25 #include "views/controls/label.h" |
| 25 #include "views/controls/throbber.h" | 26 #include "views/controls/throbber.h" |
| 26 #include "views/grid_layout.h" | 27 #include "views/grid_layout.h" |
| 27 #include "views/standard_layout.h" | 28 #include "views/standard_layout.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 334 |
| 334 void NetworkSelectionView::OnLocaleChanged() { | 335 void NetworkSelectionView::OnLocaleChanged() { |
| 335 UpdateLocalizedStrings(); | 336 UpdateLocalizedStrings(); |
| 336 // Proxy settings dialog contains localized title. Zap it. | 337 // Proxy settings dialog contains localized title. Zap it. |
| 337 proxy_settings_dialog_.reset(NULL); | 338 proxy_settings_dialog_.reset(NULL); |
| 338 | 339 |
| 339 Layout(); | 340 Layout(); |
| 340 SchedulePaint(); | 341 SchedulePaint(); |
| 341 } | 342 } |
| 342 | 343 |
| 344 void NetworkSelectionView::ViewHierarchyChanged(bool is_add, |
| 345 View* parent, |
| 346 View* child) { |
| 347 if (is_add && this == child) |
| 348 WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); |
| 349 } |
| 350 |
| 343 //////////////////////////////////////////////////////////////////////////////// | 351 //////////////////////////////////////////////////////////////////////////////// |
| 344 // NetworkSelectionView, public: | 352 // NetworkSelectionView, public: |
| 345 | 353 |
| 346 gfx::NativeWindow NetworkSelectionView::GetNativeWindow() const { | 354 gfx::NativeWindow NetworkSelectionView::GetNativeWindow() const { |
| 347 return GTK_WINDOW(static_cast<WidgetGtk*>(GetWidget())->GetNativeView()); | 355 return GTK_WINDOW(static_cast<WidgetGtk*>(GetWidget())->GetNativeView()); |
| 348 } | 356 } |
| 349 | 357 |
| 350 views::View* NetworkSelectionView::GetNetworkControlView() const { | 358 views::View* NetworkSelectionView::GetNetworkControlView() const { |
| 351 return network_dropdown_; | 359 return network_dropdown_; |
| 352 } | 360 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 l10n_util::GetString(IDS_NETWORK_SELECTION_CONTINUE_BUTTON)); | 423 l10n_util::GetString(IDS_NETWORK_SELECTION_CONTINUE_BUTTON)); |
| 416 continue_button_->SetEnabled(is_continue_enabled); | 424 continue_button_->SetEnabled(is_continue_enabled); |
| 417 } | 425 } |
| 418 | 426 |
| 419 void NetworkSelectionView::UpdateConnectingNetworkLabel() { | 427 void NetworkSelectionView::UpdateConnectingNetworkLabel() { |
| 420 connecting_network_label_->SetText(l10n_util::GetStringF( | 428 connecting_network_label_->SetText(l10n_util::GetStringF( |
| 421 IDS_NETWORK_SELECTION_CONNECTING, UTF16ToWide(network_id_))); | 429 IDS_NETWORK_SELECTION_CONNECTING, UTF16ToWide(network_id_))); |
| 422 } | 430 } |
| 423 | 431 |
| 424 } // namespace chromeos | 432 } // namespace chromeos |
| OLD | NEW |