| 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 "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 base::string16 NetworkConfigView::GetWindowTitle() const { | 203 base::string16 NetworkConfigView::GetWindowTitle() const { |
| 204 DCHECK(!child_config_view_->GetTitle().empty()); | 204 DCHECK(!child_config_view_->GetTitle().empty()); |
| 205 return child_config_view_->GetTitle(); | 205 return child_config_view_->GetTitle(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 ui::ModalType NetworkConfigView::GetModalType() const { | 208 ui::ModalType NetworkConfigView::GetModalType() const { |
| 209 return ui::MODAL_TYPE_SYSTEM; | 209 return ui::MODAL_TYPE_SYSTEM; |
| 210 } | 210 } |
| 211 | 211 |
| 212 void NetworkConfigView::GetAccessibleState(ui::AXViewState* state) { | 212 void NetworkConfigView::GetAccessibleState(ui::AXViewState* state) { |
| 213 views::DialogDelegateView::GetAccessibleState(state); |
| 213 state->name = | 214 state->name = |
| 214 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_WIFI_NETWORKS); | 215 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_WIFI_NETWORKS); |
| 215 state->role = ui::AX_ROLE_DIALOG; | |
| 216 } | 216 } |
| 217 | 217 |
| 218 void NetworkConfigView::ButtonPressed(views::Button* sender, | 218 void NetworkConfigView::ButtonPressed(views::Button* sender, |
| 219 const ui::Event& event) { | 219 const ui::Event& event) { |
| 220 if (advanced_button_ && sender == advanced_button_) { | 220 if (advanced_button_ && sender == advanced_button_) { |
| 221 advanced_button_->SetVisible(false); | 221 advanced_button_->SetVisible(false); |
| 222 ShowAdvancedView(); | 222 ShowAdvancedView(); |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 result.set_height(size.height()); | 259 result.set_height(size.height()); |
| 260 if (size.width() > result.width()) | 260 if (size.width() > result.width()) |
| 261 result.set_width(size.width()); | 261 result.set_width(size.width()); |
| 262 return result; | 262 return result; |
| 263 } | 263 } |
| 264 | 264 |
| 265 void NetworkConfigView::ViewHierarchyChanged( | 265 void NetworkConfigView::ViewHierarchyChanged( |
| 266 const ViewHierarchyChangedDetails& details) { | 266 const ViewHierarchyChangedDetails& details) { |
| 267 // Can't init before we're inserted into a Container, because we require | 267 // Can't init before we're inserted into a Container, because we require |
| 268 // a HWND to parent native child controls to. | 268 // a HWND to parent native child controls to. |
| 269 views::DialogDelegateView::ViewHierarchyChanged(details); |
| 269 if (details.is_add && details.child == this) { | 270 if (details.is_add && details.child == this) { |
| 270 AddChildView(child_config_view_); | 271 AddChildView(child_config_view_); |
| 271 } | 272 } |
| 272 } | 273 } |
| 273 | 274 |
| 274 void NetworkConfigView::ShowDialog(gfx::NativeWindow parent) { | 275 void NetworkConfigView::ShowDialog(gfx::NativeWindow parent) { |
| 275 if (parent == NULL) | 276 if (parent == NULL) |
| 276 parent = GetParentForUnhostedDialog(); | 277 parent = GetParentForUnhostedDialog(); |
| 277 // Failed connections may result in a pop-up with no natural parent window, | 278 // Failed connections may result in a pop-up with no natural parent window, |
| 278 // so provide a fallback context on the primary display. This is necessary | 279 // so provide a fallback context on the primary display. This is necessary |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 image_view_ = new views::ImageView(); | 351 image_view_ = new views::ImageView(); |
| 351 // Disable |image_view_| so mouse events propagate to the parent. | 352 // Disable |image_view_| so mouse events propagate to the parent. |
| 352 image_view_->SetEnabled(false); | 353 image_view_->SetEnabled(false); |
| 353 image_view_->SetImage(image_); | 354 image_view_->SetImage(image_); |
| 354 image_view_->SetTooltipText( | 355 image_view_->SetTooltipText( |
| 355 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); | 356 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); |
| 356 AddChildView(image_view_); | 357 AddChildView(image_view_); |
| 357 } | 358 } |
| 358 | 359 |
| 359 } // namespace chromeos | 360 } // namespace chromeos |
| OLD | NEW |