| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 NOTREACHED(); | 110 NOTREACHED(); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 NetworkConfigView::~NetworkConfigView() { | 114 NetworkConfigView::~NetworkConfigView() { |
| 115 DCHECK(GetActiveDialog() == this); | 115 DCHECK(GetActiveDialog() == this); |
| 116 SetActiveDialog(NULL); | 116 SetActiveDialog(NULL); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // static | 119 // static |
| 120 bool NetworkConfigView::Show(Network* network, gfx::NativeWindow parent) { | 120 void NetworkConfigView::Show(Network* network, gfx::NativeWindow parent) { |
| 121 if (GetActiveDialog() != NULL) | 121 if (GetActiveDialog() != NULL) |
| 122 return false; | 122 return; |
| 123 NetworkConfigView* view = new NetworkConfigView(network); | 123 NetworkConfigView* view = new NetworkConfigView(network); |
| 124 view->ShowDialog(parent); | 124 view->ShowDialog(parent); |
| 125 return true; | |
| 126 } | 125 } |
| 127 | 126 |
| 128 // static | 127 // static |
| 129 bool NetworkConfigView::ShowForType(ConnectionType type, | 128 void NetworkConfigView::ShowForType(ConnectionType type, |
| 130 gfx::NativeWindow parent) { | 129 gfx::NativeWindow parent) { |
| 131 if (GetActiveDialog() != NULL) | 130 if (GetActiveDialog() != NULL) |
| 132 return false; | 131 return; |
| 133 NetworkConfigView* view = new NetworkConfigView(type); | 132 NetworkConfigView* view = new NetworkConfigView(type); |
| 134 view->ShowDialog(parent); | 133 view->ShowDialog(parent); |
| 135 return true; | |
| 136 } | 134 } |
| 137 | 135 |
| 138 gfx::NativeWindow NetworkConfigView::GetNativeWindow() const { | 136 gfx::NativeWindow NetworkConfigView::GetNativeWindow() const { |
| 139 return GetWidget()->GetNativeWindow(); | 137 return GetWidget()->GetNativeWindow(); |
| 140 } | 138 } |
| 141 | 139 |
| 142 string16 NetworkConfigView::GetDialogButtonLabel( | 140 string16 NetworkConfigView::GetDialogButtonLabel( |
| 143 ui::DialogButton button) const { | 141 ui::DialogButton button) const { |
| 144 if (button == ui::DIALOG_BUTTON_OK) | 142 if (button == ui::DIALOG_BUTTON_OK) |
| 145 return l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_CONNECT); | 143 return l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_CONNECT); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 image_view_ = new views::ImageView(); | 308 image_view_ = new views::ImageView(); |
| 311 // Disable |image_view_| so mouse events propagate to the parent. | 309 // Disable |image_view_| so mouse events propagate to the parent. |
| 312 image_view_->SetEnabled(false); | 310 image_view_->SetEnabled(false); |
| 313 image_view_->SetImage(gray_image_); | 311 image_view_->SetImage(gray_image_); |
| 314 image_view_->SetTooltipText( | 312 image_view_->SetTooltipText( |
| 315 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); | 313 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); |
| 316 AddChildView(image_view_); | 314 AddChildView(image_view_); |
| 317 } | 315 } |
| 318 | 316 |
| 319 } // namespace chromeos | 317 } // namespace chromeos |
| OLD | NEW |