| 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/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 DriveIntegrationService* integration_service = | 735 DriveIntegrationService* integration_service = |
| 736 FindDriveIntegrationService(); | 736 FindDriveIntegrationService(); |
| 737 if (!integration_service) | 737 if (!integration_service) |
| 738 return; | 738 return; |
| 739 | 739 |
| 740 *list = ConvertToDriveStatusList( | 740 *list = ConvertToDriveStatusList( |
| 741 integration_service->job_list()->GetJobInfoList()); | 741 integration_service->job_list()->GetJobInfoList()); |
| 742 } | 742 } |
| 743 | 743 |
| 744 virtual void ConfigureNetwork(const std::string& network_id) OVERRIDE { | 744 virtual void ConfigureNetwork(const std::string& network_id) OVERRIDE { |
| 745 const chromeos::NetworkState* network = network_id.empty() ? NULL : | 745 network_connect::HandleUnconfiguredNetwork(network_id, GetNativeWindow()); |
| 746 NetworkHandler::Get()->network_state_handler()->GetNetworkState( | |
| 747 network_id); | |
| 748 if (!network) { | |
| 749 LOG(ERROR) << "ConfigureNetwork: Network not found: " << network_id; | |
| 750 return; | |
| 751 } | |
| 752 if (network->type() == flimflam::kTypeWifi || | |
| 753 network->type() == flimflam::kTypeWimax || | |
| 754 network->type() == flimflam::kTypeVPN) { | |
| 755 // TODO(stevenjb): Replace with non-NetworkLibrary UI. | |
| 756 Network* cros_network = CrosLibrary::Get()->GetNetworkLibrary()-> | |
| 757 FindNetworkByPath(network_id); | |
| 758 NetworkConfigView::Show(cros_network, GetNativeWindow()); | |
| 759 return; | |
| 760 } | |
| 761 if (network->type() == flimflam::kTypeCellular) { | |
| 762 if (network->activation_state() != flimflam::kActivationStateActivated) | |
| 763 network_connect::ActivateCellular(network_id); | |
| 764 else if (network->cellular_out_of_credits()) | |
| 765 network_connect::ShowMobileSetup(network_id); | |
| 766 return; | |
| 767 } | |
| 768 // No special configure or setup for |network_id|, show the settings UI. | |
| 769 ShowNetworkSettings(network_id); | |
| 770 } | 746 } |
| 771 | 747 |
| 772 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { | 748 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { |
| 773 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( | 749 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( |
| 774 chromeos::switches::kUseNewNetworkConnectionHandler)); | 750 chromeos::switches::kUseNewNetworkConnectionHandler)); |
| 775 network_connect::ConnectResult result = | 751 network_connect::ConnectResult result = |
| 776 network_connect::ConnectToNetwork(network_id, GetNativeWindow()); | 752 network_connect::ConnectToNetwork(network_id, GetNativeWindow()); |
| 777 if (result == network_connect::NETWORK_NOT_FOUND) | 753 if (result == network_connect::NETWORK_NOT_FOUND) |
| 778 ShowNetworkSettings(""); | 754 ShowNetworkSettings(""); |
| 779 else if (result == network_connect::CONNECT_NOT_STARTED) | 755 else if (result == network_connect::CONNECT_NOT_STARTED) |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1322 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1347 }; | 1323 }; |
| 1348 | 1324 |
| 1349 } // namespace | 1325 } // namespace |
| 1350 | 1326 |
| 1351 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1327 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1352 return new chromeos::SystemTrayDelegate(); | 1328 return new chromeos::SystemTrayDelegate(); |
| 1353 } | 1329 } |
| 1354 | 1330 |
| 1355 } // namespace chromeos | 1331 } // namespace chromeos |
| OLD | NEW |