| 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/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 views::View* NetworkConfigView::CreateExtraView() { | 173 views::View* NetworkConfigView::CreateExtraView() { |
| 174 return advanced_button_; | 174 return advanced_button_; |
| 175 } | 175 } |
| 176 | 176 |
| 177 views::View* NetworkConfigView::GetInitiallyFocusedView() { | 177 views::View* NetworkConfigView::GetInitiallyFocusedView() { |
| 178 return child_config_view_->GetInitiallyFocusedView(); | 178 return child_config_view_->GetInitiallyFocusedView(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 string16 NetworkConfigView::GetWindowTitle() const { |
| 182 DCHECK(!child_config_view_->GetTitle().empty()); |
| 183 return child_config_view_->GetTitle(); |
| 184 } |
| 185 |
| 181 ui::ModalType NetworkConfigView::GetModalType() const { | 186 ui::ModalType NetworkConfigView::GetModalType() const { |
| 182 return ui::MODAL_TYPE_SYSTEM; | 187 return ui::MODAL_TYPE_SYSTEM; |
| 183 } | 188 } |
| 184 | 189 |
| 185 void NetworkConfigView::GetAccessibleState(ui::AccessibleViewState* state) { | 190 void NetworkConfigView::GetAccessibleState(ui::AccessibleViewState* state) { |
| 186 state->name = | 191 state->name = |
| 187 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_WIFI_NETWORKS); | 192 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_WIFI_NETWORKS); |
| 188 state->role = ui::AccessibilityTypes::ROLE_DIALOG; | 193 state->role = ui::AccessibilityTypes::ROLE_DIALOG; |
| 189 } | 194 } |
| 190 | 195 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 if (details.is_add && details.child == this) { | 245 if (details.is_add && details.child == this) { |
| 241 AddChildView(child_config_view_); | 246 AddChildView(child_config_view_); |
| 242 } | 247 } |
| 243 } | 248 } |
| 244 | 249 |
| 245 void NetworkConfigView::ShowDialog(gfx::NativeWindow parent) { | 250 void NetworkConfigView::ShowDialog(gfx::NativeWindow parent) { |
| 246 if (parent == NULL) | 251 if (parent == NULL) |
| 247 parent = GetDialogParent(); | 252 parent = GetDialogParent(); |
| 248 // Failed connections may result in a pop-up with no natural parent window, | 253 // Failed connections may result in a pop-up with no natural parent window, |
| 249 // so provide a fallback context on the active display. | 254 // so provide a fallback context on the active display. |
| 250 Widget* window = parent ? | 255 gfx::NativeWindow context = parent ? NULL : ash::Shell::GetActiveRootWindow(); |
| 251 Widget::CreateWindowWithParent(this, parent) : | 256 Widget* window = DialogDelegate::CreateDialogWidget(this, context, parent); |
| 252 Widget::CreateWindowWithContext(this, ash::Shell::GetActiveRootWindow()); | |
| 253 window->SetAlwaysOnTop(true); | 257 window->SetAlwaysOnTop(true); |
| 254 window->Show(); | 258 window->Show(); |
| 255 } | 259 } |
| 256 | 260 |
| 257 ControlledSettingIndicatorView::ControlledSettingIndicatorView() | 261 ControlledSettingIndicatorView::ControlledSettingIndicatorView() |
| 258 : managed_(false), | 262 : managed_(false), |
| 259 image_view_(NULL) { | 263 image_view_(NULL) { |
| 260 Init(); | 264 Init(); |
| 261 } | 265 } |
| 262 | 266 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 image_view_ = new views::ImageView(); | 310 image_view_ = new views::ImageView(); |
| 307 // Disable |image_view_| so mouse events propagate to the parent. | 311 // Disable |image_view_| so mouse events propagate to the parent. |
| 308 image_view_->SetEnabled(false); | 312 image_view_->SetEnabled(false); |
| 309 image_view_->SetImage(gray_image_); | 313 image_view_->SetImage(gray_image_); |
| 310 image_view_->SetTooltipText( | 314 image_view_->SetTooltipText( |
| 311 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); | 315 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); |
| 312 AddChildView(image_view_); | 316 AddChildView(image_view_); |
| 313 } | 317 } |
| 314 | 318 |
| 315 } // namespace chromeos | 319 } // namespace chromeos |
| OLD | NEW |