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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 DriveIntegrationService* integration_service = | 725 DriveIntegrationService* integration_service = |
726 FindDriveIntegrationService(); | 726 FindDriveIntegrationService(); |
727 if (!integration_service) | 727 if (!integration_service) |
728 return; | 728 return; |
729 | 729 |
730 *list = ConvertToDriveStatusList( | 730 *list = ConvertToDriveStatusList( |
731 integration_service->job_list()->GetJobInfoList()); | 731 integration_service->job_list()->GetJobInfoList()); |
732 } | 732 } |
733 | 733 |
734 virtual void ConfigureNetwork(const std::string& network_id) OVERRIDE { | 734 virtual void ConfigureNetwork(const std::string& network_id) OVERRIDE { |
735 const chromeos::NetworkState* network = network_id.empty() ? NULL : | 735 network_connect::ConfigureNetwork(network_id, GetNativeWindow()); |
736 NetworkHandler::Get()->network_state_handler()->GetNetworkState( | |
737 network_id); | |
738 if (!network) { | |
739 LOG(ERROR) << "ConfigureNetwork: Network not found: " << network_id; | |
740 return; | |
741 } | |
742 if (network->type() == flimflam::kTypeWifi || | |
743 network->type() == flimflam::kTypeWimax || | |
744 network->type() == flimflam::kTypeVPN) { | |
745 // TODO(stevenjb): Replace with non-NetworkLibrary UI. | |
746 Network* cros_network = CrosLibrary::Get()->GetNetworkLibrary()-> | |
747 FindNetworkByPath(network_id); | |
748 NetworkConfigView::Show(cros_network, GetNativeWindow()); | |
749 return; | |
750 } | |
751 if (network->type() == flimflam::kTypeCellular) { | |
752 if (network->activation_state() != flimflam::kActivationStateActivated) | |
753 network_connect::ActivateCellular(network_id); | |
754 else if (network->cellular_out_of_credits()) | |
755 network_connect::ShowMobileSetup(network_id); | |
756 return; | |
757 } | |
758 // No special configure or setup for |network_id|, show the settings UI. | |
759 ShowNetworkSettings(network_id); | |
760 } | 736 } |
761 | 737 |
762 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { | 738 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { |
763 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( | 739 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( |
764 chromeos::switches::kUseNewNetworkConnectionHandler)); | 740 chromeos::switches::kUseNewNetworkConnectionHandler)); |
765 network_connect::ConnectResult result = | 741 network_connect::ConnectResult result = |
766 network_connect::ConnectToNetwork(network_id, GetNativeWindow()); | 742 network_connect::ConnectToNetwork(network_id, GetNativeWindow()); |
767 if (result == network_connect::NETWORK_NOT_FOUND) | 743 if (result == network_connect::NETWORK_NOT_FOUND) |
768 ShowNetworkSettings(""); | 744 ShowNetworkSettings(""); |
769 else if (result == network_connect::CONNECT_NOT_STARTED) | 745 else if (result == network_connect::CONNECT_NOT_STARTED) |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1301 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
1326 }; | 1302 }; |
1327 | 1303 |
1328 } // namespace | 1304 } // namespace |
1329 | 1305 |
1330 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1306 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1331 return new chromeos::SystemTrayDelegate(); | 1307 return new chromeos::SystemTrayDelegate(); |
1332 } | 1308 } |
1333 | 1309 |
1334 } // namespace chromeos | 1310 } // namespace chromeos |
OLD | NEW |