OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/system/chromeos/network/network_connect.h" | 5 #include "ash/system/chromeos/network/network_connect.h" |
6 | 6 |
| 7 #include "ash/session_state_delegate.h" |
7 #include "ash/shell.h" | 8 #include "ash/shell.h" |
8 #include "ash/system/chromeos/network/network_state_notifier.h" | 9 #include "ash/system/chromeos/network/network_state_notifier.h" |
9 #include "ash/system/system_notifier.h" | 10 #include "ash/system/system_notifier.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
11 #include "ash/system/tray/system_tray_notifier.h" | 12 #include "ash/system/tray/system_tray_notifier.h" |
12 #include "base/bind.h" | 13 #include "base/bind.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
15 #include "base/values.h" | 16 #include "base/values.h" |
16 #include "chromeos/login/login_state.h" | 17 #include "chromeos/login/login_state.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 network_connect::ShowNetworkSettings(service_path); | 149 network_connect::ShowNetworkSettings(service_path); |
149 return; | 150 return; |
150 } | 151 } |
151 | 152 |
152 // ConnectFailed or unknown error; show a notification. | 153 // ConnectFailed or unknown error; show a notification. |
153 std::string shill_error; | 154 std::string shill_error; |
154 error_data.get()->GetString( | 155 error_data.get()->GetString( |
155 chromeos::network_handler::kErrorDetail, &shill_error); | 156 chromeos::network_handler::kErrorDetail, &shill_error); |
156 ShowErrorNotification(error_name, shill_error, service_path); | 157 ShowErrorNotification(error_name, shill_error, service_path); |
157 | 158 |
158 // Show a configure dialog for ConnectFailed errors. | 159 // Only show a configure dialog if there was a ConnectFailed error and the |
159 if (error_name != shill::kErrorConnectFailed) | 160 // screen is not locked. |
| 161 if (error_name != shill::kErrorConnectFailed || |
| 162 Shell::GetInstance()->session_state_delegate()->IsScreenLocked()) |
160 return; | 163 return; |
161 | 164 |
162 // If Shill reports an InProgress error, don't try to configure the network. | 165 // If Shill reports an InProgress error, don't try to configure the network. |
163 std::string dbus_error_name; | 166 std::string dbus_error_name; |
164 error_data.get()->GetString( | 167 error_data.get()->GetString( |
165 chromeos::network_handler::kDbusErrorName, &dbus_error_name); | 168 chromeos::network_handler::kDbusErrorName, &dbus_error_name); |
166 if (dbus_error_name == kErrorInProgress) | 169 if (dbus_error_name == kErrorInProgress) |
167 return; | 170 return; |
168 | 171 |
169 HandleUnconfiguredNetwork(service_path, parent_window); | 172 HandleUnconfiguredNetwork(service_path, parent_window); |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 570 |
568 void ShowNetworkSettings(const std::string& service_path) { | 571 void ShowNetworkSettings(const std::string& service_path) { |
569 if (!ash::Shell::HasInstance()) | 572 if (!ash::Shell::HasInstance()) |
570 return; | 573 return; |
571 ash::Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings( | 574 ash::Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings( |
572 service_path); | 575 service_path); |
573 } | 576 } |
574 | 577 |
575 } // network_connect | 578 } // network_connect |
576 } // ash | 579 } // ash |
OLD | NEW |