| 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 "ash/system/chromeos/network/tray_network.h" | 5 #include "ash/system/chromeos/network/tray_network.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/chromeos/network/network_icon_animation.h" | 9 #include "ash/system/chromeos/network/network_icon_animation.h" |
| 10 #include "ash/system/chromeos/network/network_list_detailed_view.h" | 10 #include "ash/system/chromeos/network/network_list_detailed_view.h" |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 connecting_networks_.erase(network->path()); | 543 connecting_networks_.erase(network->path()); |
| 544 } | 544 } |
| 545 | 545 |
| 546 void TrayNetwork::ConnectToNetwork(const std::string& service_path) { | 546 void TrayNetwork::ConnectToNetwork(const std::string& service_path) { |
| 547 DCHECK(UseNewNetworkHandlers()); | 547 DCHECK(UseNewNetworkHandlers()); |
| 548 const NetworkState* network = | 548 const NetworkState* network = |
| 549 NetworkStateHandler::Get()->GetNetworkState(service_path); | 549 NetworkStateHandler::Get()->GetNetworkState(service_path); |
| 550 if (!network) | 550 if (!network) |
| 551 return; | 551 return; |
| 552 if (CommandLine::ForCurrentProcess()->HasSwitch( | 552 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 553 chromeos::switches::kEnableNewNetworkConfigurationHandlers) && | 553 chromeos::switches::kUseNewNetworkConfigurationHandlers) && |
| 554 !network->IsConnectedState()) { | 554 !network->IsConnectedState()) { |
| 555 chromeos::NetworkConfigurationHandler::Get()->Connect( | 555 chromeos::NetworkConfigurationHandler::Get()->Connect( |
| 556 service_path, | 556 service_path, |
| 557 base::Bind(&base::DoNothing), | 557 base::Bind(&base::DoNothing), |
| 558 chromeos::network_handler::ErrorCallback()); | 558 chromeos::network_handler::ErrorCallback()); |
| 559 connecting_networks_.insert(service_path); | 559 connecting_networks_.insert(service_path); |
| 560 } else { | 560 } else { |
| 561 // This will show the settings UI for a connected network. | 561 // This will show the settings UI for a connected network. |
| 562 // TODO(stevenjb): Change the API to explicitly show network settings. | 562 // TODO(stevenjb): Change the API to explicitly show network settings. |
| 563 Shell::GetInstance()->system_tray_delegate()->ConnectToNetwork( | 563 Shell::GetInstance()->system_tray_delegate()->ConnectToNetwork( |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 | 641 |
| 642 void TrayNetwork::LinkClicked(MessageType message_type, int link_id) { | 642 void TrayNetwork::LinkClicked(MessageType message_type, int link_id) { |
| 643 tray::NetworkMessages::MessageMap::const_iterator iter = | 643 tray::NetworkMessages::MessageMap::const_iterator iter = |
| 644 messages()->messages().find(message_type); | 644 messages()->messages().find(message_type); |
| 645 if (iter != messages()->messages().end() && iter->second.delegate) | 645 if (iter != messages()->messages().end() && iter->second.delegate) |
| 646 iter->second.delegate->NotificationLinkClicked(link_id); | 646 iter->second.delegate->NotificationLinkClicked(link_id); |
| 647 } | 647 } |
| 648 | 648 |
| 649 } // namespace internal | 649 } // namespace internal |
| 650 } // namespace ash | 650 } // namespace ash |
| OLD | NEW |