Index: extensions/shell/browser/shell_network_controller_chromeos.cc |
diff --git a/apps/shell/browser/shell_network_controller_chromeos.cc b/extensions/shell/browser/shell_network_controller_chromeos.cc |
similarity index 86% |
rename from apps/shell/browser/shell_network_controller_chromeos.cc |
rename to extensions/shell/browser/shell_network_controller_chromeos.cc |
index 0b66604b4f41312f9c6e6952f6dc22d365443d5e..d321e236dd1e556d9ee873996771c9ff911e35d0 100644 |
--- a/apps/shell/browser/shell_network_controller_chromeos.cc |
+++ b/extensions/shell/browser/shell_network_controller_chromeos.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "apps/shell/browser/shell_network_controller_chromeos.h" |
+#include "extensions/shell/browser/shell_network_controller_chromeos.h" |
#include "base/bind.h" |
#include "base/location.h" |
@@ -16,7 +16,7 @@ |
#include "chromeos/network/network_state_handler.h" |
#include "third_party/cros_system_api/dbus/service_constants.h" |
-namespace apps { |
+namespace extensions { |
namespace { |
@@ -24,16 +24,16 @@ namespace { |
// or when connected to a non-preferred network. |
const int kScanIntervalSec = 10; |
-void HandleEnableWifiError( |
- const std::string& error_name, |
- scoped_ptr<base::DictionaryValue> error_data) { |
+void HandleEnableWifiError(const std::string& error_name, |
+ scoped_ptr<base::DictionaryValue> error_data) { |
LOG(WARNING) << "Unable to enable wifi: " << error_name; |
} |
// Returns a human-readable name for the network described by |network|. |
std::string GetNetworkName(const chromeos::NetworkState& network) { |
- return !network.name().empty() ? network.name() : |
- base::StringPrintf("[%s]", network.type().c_str()); |
+ return !network.name().empty() |
+ ? network.name() |
+ : base::StringPrintf("[%s]", network.type().c_str()); |
} |
// Returns true if shill is either connected or connecting to a network. |
@@ -60,7 +60,8 @@ ShellNetworkController::ShellNetworkController( |
state_handler->AddObserver(this, FROM_HERE); |
state_handler->SetTechnologyEnabled( |
chromeos::NetworkTypePattern::Primitive(shill::kTypeWifi), |
- true, base::Bind(&HandleEnableWifiError)); |
+ true, |
+ base::Bind(&HandleEnableWifiError)); |
// If we're unconnected, trigger a connection attempt and start scanning. |
NetworkConnectionStateChanged(NULL); |
@@ -82,8 +83,7 @@ void ShellNetworkController::NetworkConnectionStateChanged( |
if (network) { |
VLOG(1) << "Network connection state changed:" |
<< " name=" << GetNetworkName(*network) |
- << " type=" << network->type() |
- << " path=" << network->path() |
+ << " type=" << network->type() << " path=" << network->path() |
<< " state=" << network->connection_state(); |
} else { |
VLOG(1) << "Network connection state changed: [none]"; |
@@ -104,15 +104,15 @@ void ShellNetworkController::NetworkConnectionStateChanged( |
} |
} |
-const chromeos::NetworkState* |
-ShellNetworkController::GetActiveWiFiNetwork() { |
+const chromeos::NetworkState* ShellNetworkController::GetActiveWiFiNetwork() { |
chromeos::NetworkStateHandler* state_handler = |
chromeos::NetworkHandler::Get()->network_state_handler(); |
const chromeos::NetworkState* network = state_handler->FirstNetworkByType( |
chromeos::NetworkTypePattern::Primitive(shill::kTypeWifi)); |
return network && |
- (network->IsConnectedState() || network->IsConnectingState()) ? |
- network : NULL; |
+ (network->IsConnectedState() || network->IsConnectingState()) |
+ ? network |
+ : NULL; |
} |
void ShellNetworkController::SetScanningEnabled(bool enabled) { |
@@ -125,7 +125,8 @@ void ShellNetworkController::SetScanningEnabled(bool enabled) { |
RequestScan(); |
scan_timer_.Start(FROM_HERE, |
base::TimeDelta::FromSeconds(kScanIntervalSec), |
- this, &ShellNetworkController::RequestScan); |
+ this, |
+ &ShellNetworkController::RequestScan); |
} else { |
scan_timer_.Stop(); |
} |
@@ -151,7 +152,9 @@ void ShellNetworkController::ConnectIfUnconnected() { |
handler->network_state_handler()->GetVisibleNetworkListByType( |
chromeos::NetworkTypePattern::WiFi(), &network_list); |
for (chromeos::NetworkStateHandler::NetworkStateList::const_iterator it = |
- network_list.begin(); it != network_list.end(); ++it) { |
+ network_list.begin(); |
+ it != network_list.end(); |
+ ++it) { |
const chromeos::NetworkState* network = *it; |
if (!network->connectable()) |
continue; |
@@ -180,9 +183,9 @@ void ShellNetworkController::ConnectIfUnconnected() { |
VLOG(1) << "Connecting to network " << GetNetworkName(*best_network) |
<< " with path " << best_network->path() << " and strength " |
<< best_network->signal_strength(); |
- state_ = can_connect_to_preferred_network ? |
- STATE_WAITING_FOR_PREFERRED_RESULT : |
- STATE_WAITING_FOR_NON_PREFERRED_RESULT; |
+ state_ = can_connect_to_preferred_network |
+ ? STATE_WAITING_FOR_PREFERRED_RESULT |
+ : STATE_WAITING_FOR_NON_PREFERRED_RESULT; |
handler->network_connection_handler()->ConnectToNetwork( |
best_network->path(), |
base::Bind(&ShellNetworkController::HandleConnectionSuccess, |
@@ -204,4 +207,4 @@ void ShellNetworkController::HandleConnectionError( |
state_ = STATE_IDLE; |
} |
-} // namespace apps |
+} // namespace extensions |