| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 11 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 12 #include "chrome/browser/chromeos/options/network_property_ui_data.h" | 12 #include "chrome/browser/chromeos/options/network_property_ui_data.h" |
| 13 #include "chrome/browser/chromeos/options/vpn_config_view.h" | 13 #include "chrome/browser/chromeos/options/vpn_config_view.h" |
| 14 #include "chrome/browser/chromeos/options/wifi_config_view.h" | 14 #include "chrome/browser/chromeos/options/wifi_config_view.h" |
| 15 #include "chrome/browser/chromeos/options/wimax_config_view.h" | 15 #include "chrome/browser/chromeos/options/wimax_config_view.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/ui/ash/ash_util.h" | 17 #include "chrome/browser/ui/ash/ash_util.h" |
| 18 #include "chrome/browser/ui/ash/system_tray_client.h" | 18 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
| 22 #include "chrome/grit/generated_resources.h" | 22 #include "chrome/grit/generated_resources.h" |
| 23 #include "chrome/grit/locale_settings.h" | 23 #include "chrome/grit/locale_settings.h" |
| 24 #include "chromeos/login/login_state.h" | 24 #include "chromeos/login/login_state.h" |
| 25 #include "chromeos/network/network_state.h" | 25 #include "chromeos/network/network_state.h" |
| 26 #include "chromeos/network/network_state_handler.h" | 26 #include "chromeos/network/network_state_handler.h" |
| 27 #include "components/device_event_log/device_event_log.h" | 27 #include "components/device_event_log/device_event_log.h" |
| 28 #include "components/user_manager/user.h" | 28 #include "components/user_manager/user.h" |
| 29 #include "ui/accessibility/ax_view_state.h" | 29 #include "ui/accessibility/ax_node_data.h" |
| 30 #include "ui/aura/window_event_dispatcher.h" | 30 #include "ui/aura/window_event_dispatcher.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 32 #include "ui/gfx/color_palette.h" | 32 #include "ui/gfx/color_palette.h" |
| 33 #include "ui/gfx/geometry/rect.h" | 33 #include "ui/gfx/geometry/rect.h" |
| 34 #include "ui/gfx/image/image.h" | 34 #include "ui/gfx/image/image.h" |
| 35 #include "ui/gfx/paint_vector_icon.h" | 35 #include "ui/gfx/paint_vector_icon.h" |
| 36 #include "ui/gfx/vector_icons_public.h" | 36 #include "ui/gfx/vector_icons_public.h" |
| 37 #include "ui/views/controls/button/md_text_button.h" | 37 #include "ui/views/controls/button/md_text_button.h" |
| 38 #include "ui/views/controls/image_view.h" | 38 #include "ui/views/controls/image_view.h" |
| 39 #include "ui/views/layout/fill_layout.h" | 39 #include "ui/views/layout/fill_layout.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 base::string16 NetworkConfigView::GetWindowTitle() const { | 202 base::string16 NetworkConfigView::GetWindowTitle() const { |
| 203 DCHECK(!child_config_view_->GetTitle().empty()); | 203 DCHECK(!child_config_view_->GetTitle().empty()); |
| 204 return child_config_view_->GetTitle(); | 204 return child_config_view_->GetTitle(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 ui::ModalType NetworkConfigView::GetModalType() const { | 207 ui::ModalType NetworkConfigView::GetModalType() const { |
| 208 return ui::MODAL_TYPE_SYSTEM; | 208 return ui::MODAL_TYPE_SYSTEM; |
| 209 } | 209 } |
| 210 | 210 |
| 211 void NetworkConfigView::GetAccessibleState(ui::AXViewState* state) { | 211 void NetworkConfigView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 212 views::DialogDelegateView::GetAccessibleState(state); | 212 views::DialogDelegateView::GetAccessibleNodeData(node_data); |
| 213 state->name = | 213 node_data->SetName( |
| 214 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_WIFI_NETWORKS); | 214 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_OTHER_WIFI_NETWORKS)); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void NetworkConfigView::ButtonPressed(views::Button* sender, | 217 void NetworkConfigView::ButtonPressed(views::Button* sender, |
| 218 const ui::Event& event) { | 218 const ui::Event& event) { |
| 219 if (advanced_button_ && sender == advanced_button_) { | 219 if (advanced_button_ && sender == advanced_button_) { |
| 220 advanced_button_->SetVisible(false); | 220 advanced_button_->SetVisible(false); |
| 221 ShowAdvancedView(); | 221 ShowAdvancedView(); |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 329 } |
| 330 | 330 |
| 331 ControlledSettingIndicatorView::~ControlledSettingIndicatorView() {} | 331 ControlledSettingIndicatorView::~ControlledSettingIndicatorView() {} |
| 332 | 332 |
| 333 gfx::Size ControlledSettingIndicatorView::GetPreferredSize() const { | 333 gfx::Size ControlledSettingIndicatorView::GetPreferredSize() const { |
| 334 return (managed_ && visible()) ? image_view_->GetPreferredSize() | 334 return (managed_ && visible()) ? image_view_->GetPreferredSize() |
| 335 : gfx::Size(); | 335 : gfx::Size(); |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace chromeos | 338 } // namespace chromeos |
| OLD | NEW |