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/status/network_menu.h" | 5 #include "chrome/browser/chromeos/status/network_menu.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 info->status = kNetworkStatusDisconnected; | 141 info->status = kNetworkStatusDisconnected; |
142 info->message = l10n_util::GetStringUTF8( | 142 info->message = l10n_util::GetStringUTF8( |
143 IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED); | 143 IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED); |
144 } | 144 } |
145 } else { | 145 } else { |
146 info->status = kNetworkStatusDisconnected; | 146 info->status = kNetworkStatusDisconnected; |
147 info->message = l10n_util::GetStringUTF8( | 147 info->message = l10n_util::GetStringUTF8( |
148 IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED); | 148 IDS_STATUSBAR_NETWORK_DEVICE_DISCONNECTED); |
149 } | 149 } |
150 if (wifi.encrypted()) { | 150 if (wifi.encrypted()) { |
| 151 info->need_passphrase = true; |
151 if (wifi.IsCertificateLoaded() || | 152 if (wifi.IsCertificateLoaded() || |
152 wifi.encryption() == SECURITY_8021X) { | 153 wifi.encryption() == SECURITY_8021X) { |
153 info->need_passphrase = false; | 154 info->need_passphrase = false; |
154 } else { | 155 } |
155 info->need_passphrase = true; | 156 if (wifi.favorite()) { |
| 157 info->passphrase = wifi.passphrase(); |
| 158 info->need_passphrase = false; |
156 } | 159 } |
157 } else { | 160 } else { |
158 info->need_passphrase = false; | 161 info->need_passphrase = false; |
159 } | 162 } |
160 info->ip_address = wifi.ip_address(); | 163 info->ip_address = wifi.ip_address(); |
161 info->remembered = wifi.favorite(); | 164 info->remembered = wifi.favorite(); |
162 } else { | 165 } else { |
163 res = false; // Network not found, hide entry. | 166 res = false; // Network not found, hide entry. |
164 } | 167 } |
165 } else if (flags & FLAG_CELLULAR) { | 168 } else if (flags & FLAG_CELLULAR) { |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 chromeos::TYPE_WIFI); | 621 chromeos::TYPE_WIFI); |
619 browser->ShowOptionsTab(page); | 622 browser->ShowOptionsTab(page); |
620 } | 623 } |
621 } else { | 624 } else { |
622 const bool kFocusLogin = true; | 625 const bool kFocusLogin = true; |
623 ShowNetworkConfigView(new NetworkConfigView(), kFocusLogin); | 626 ShowNetworkConfigView(new NetworkConfigView(), kFocusLogin); |
624 } | 627 } |
625 } | 628 } |
626 | 629 |
627 } // namespace chromeos | 630 } // namespace chromeos |
OLD | NEW |