| Index: chrome/browser/chromeos/network_list.cc
|
| diff --git a/chrome/browser/chromeos/network_list.cc b/chrome/browser/chromeos/network_list.cc
|
| index fdc47948ef39090cb42a2ea8d98d4ae91e3d5b1d..8335af52a7c98640bfa5632eb76e707dc63a915d 100644
|
| --- a/chrome/browser/chromeos/network_list.cc
|
| +++ b/chrome/browser/chromeos/network_list.cc
|
| @@ -17,12 +17,11 @@ NetworkList::NetworkList()
|
| }
|
|
|
| NetworkList::NetworkItem* NetworkList::GetNetworkAt(int index) {
|
| - return index >= 0 && index < static_cast<int>(networks_.size()) ?
|
| - &networks_[index] : NULL;
|
| + return index >= 0 && index < size() ? &networks_[index] : NULL;
|
| }
|
|
|
| const NetworkList::NetworkItem* NetworkList::GetNetworkById(NetworkType type,
|
| - const string16& id) {
|
| + const string16& id) {
|
| return GetNetworkAt(GetNetworkIndexById(type, id));
|
| }
|
|
|
| @@ -30,7 +29,7 @@ int NetworkList::GetNetworkIndexById(NetworkType type,
|
| const string16& id) const {
|
| if (NETWORK_EMPTY == type || id.empty()) return -1;
|
| std::string network_id = UTF16ToASCII(id);
|
| - for (size_t i = 0; i < networks_.size(); i++) {
|
| + for (int i = 0; i < size(); ++i) {
|
| if (type == networks_[i].network_type) {
|
| switch (type) {
|
| case NETWORK_ETHERNET:
|
| @@ -57,22 +56,16 @@ int NetworkList::GetNetworkIndexById(NetworkType type,
|
|
|
| // Returns currently connected network if there is one.
|
| const NetworkList::NetworkItem* NetworkList::ConnectedNetwork() const {
|
| - if (connected_network_index_ >= 0 &&
|
| - connected_network_index_ < static_cast<int>(networks_.size())) {
|
| + if (connected_network_index_ >= 0 && connected_network_index_ < size())
|
| return &networks_[connected_network_index_];
|
| - } else {
|
| - return NULL;
|
| - }
|
| + return NULL;
|
| }
|
|
|
| // Returns currently connecting network if there is one.
|
| const NetworkList::NetworkItem* NetworkList::ConnectingNetwork() const {
|
| - if (connecting_network_index_ >= 0 &&
|
| - connecting_network_index_ < static_cast<int>(networks_.size())) {
|
| + if (connecting_network_index_ >= 0 && connecting_network_index_ < size())
|
| return &networks_[connecting_network_index_];
|
| - } else {
|
| - return NULL;
|
| - }
|
| + return NULL;
|
| }
|
|
|
| void NetworkList::NetworkChanged(chromeos::NetworkLibrary* network_lib) {
|
| @@ -131,14 +124,14 @@ void NetworkList::SetNetworksIndices(int index,
|
| bool connecting) {
|
| if (connected_network_index_ != -1 ||
|
| connecting_network_index_ != -1 ||
|
| - index < 0 || index >= static_cast<int>(networks_.size()))
|
| + index < 0 || index >= size()) {
|
| return;
|
| + }
|
|
|
| - if (connected) {
|
| + if (connected)
|
| connected_network_index_ = index;
|
| - } else if (connecting) {
|
| + else if (connecting)
|
| connecting_network_index_ = index;
|
| - }
|
| }
|
|
|
| } // namespace chromeos
|
|
|