diff options
author | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 21:27:42 +0000 |
---|---|---|
committer | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 21:27:42 +0000 |
commit | d1dae8a59a16bde080811ca0f4f7399be5f9658f (patch) | |
tree | 131e50f6dd7989e139512405c1aa9e856cfaed5f /chrome/browser/chromeos/cros | |
parent | c68e08c679bd051e5c42360c16b8b75f125811ad (diff) | |
download | chromium_src-d1dae8a59a16bde080811ca0f4f7399be5f9658f.zip chromium_src-d1dae8a59a16bde080811ca0f4f7399be5f9658f.tar.gz chromium_src-d1dae8a59a16bde080811ca0f4f7399be5f9658f.tar.bz2 |
Revert 67369 - Forget newly connected networks when not owner.
BUG=chromium-os:8552
TEST=See issue, but note: networks should only be remembered if the owner is logged in, i.e. 'guest' apples to any non owner login.
Review URL: http://codereview.chromium.org/5278011
TBR=stevenjb@google.com
Review URL: http://codereview.chromium.org/5548005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/cros')
-rw-r--r-- | chrome/browser/chromeos/cros/network_library.cc | 31 | ||||
-rw-r--r-- | chrome/browser/chromeos/cros/network_library.h | 8 |
2 files changed, 3 insertions, 36 deletions
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc index a1ecd0a..59fbe08 100644 --- a/chrome/browser/chromeos/cros/network_library.cc +++ b/chrome/browser/chromeos/cros/network_library.cc @@ -16,7 +16,6 @@ #include "base/values.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/chromeos/cros/cros_library.h" -#include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/common/time_format.h" #include "grit/generated_resources.h" @@ -335,13 +334,6 @@ std::string Network::GetErrorString() const { return l10n_util::GetStringUTF8(IDS_CHROMEOS_NETWORK_STATE_UNRECOGNIZED); } -std::string Network::GetBaseServicePath() const { - size_t idx = service_path_.find_last_of('/'); - if (idx == std::string::npos) - return service_path_; - return service_path_.substr(idx + 1); -} - void Network::InitIPAddress() { ip_address_.clear(); // If connected, get ip config. @@ -1069,15 +1061,6 @@ class NetworkLibraryImpl : public NetworkLibrary { wifi->set_connecting(true); wifi_ = wifi; } - // If we are not the owner, and we are providing a password, - // flag the network to be forgotten if we connect to it. - // TODO(stevenjb): Remove this once flimflam handles profiles correctly. - if (!UserManager::Get()->current_user_is_owner()) { - if (!password.empty() || !certpath.empty()) { - std::string path = network->GetBaseServicePath(); - networks_to_forget_.insert(path); - } - } NotifyNetworkManagerChanged(); return true; } else { @@ -1533,16 +1516,7 @@ class NetworkLibraryImpl : public NetworkLibrary { << " fav=" << service->favorite << " auto=" << service->auto_connect; if (service->type == TYPE_WIFI) { - WifiNetwork* wifi = new WifiNetwork(service); - remembered_wifi_networks_.push_back(wifi); - // If we are not the owner, we may need to forget this network. - std::string path = wifi->GetBaseServicePath(); - std::set<std::string>::iterator iter = - networks_to_forget_.find(path); - if (iter != networks_to_forget_.end()) { - ForgetWifiNetwork(wifi->service_path()); - networks_to_forget_.erase(iter); - } + remembered_wifi_networks_.push_back(new WifiNetwork(service)); } } } @@ -1914,9 +1888,6 @@ class NetworkLibraryImpl : public NetworkLibrary { // Delayed task to retrieve the network information. CancelableTask* update_task_; - // List of networks to forget when not the owner. - std::set<std::string> networks_to_forget_; - DISALLOW_COPY_AND_ASSIGN(NetworkLibraryImpl); }; diff --git a/chrome/browser/chromeos/cros/network_library.h b/chrome/browser/chromeos/cros/network_library.h index 566201b..c67c84e 100644 --- a/chrome/browser/chromeos/cros/network_library.h +++ b/chrome/browser/chromeos/cros/network_library.h @@ -68,10 +68,6 @@ class Network { // Return a string representation of the error code. std::string GetErrorString() const; - // Strip the base path from service_path_ and return the result. - // Useful for comparing active networks with remembered networks. - std::string GetBaseServicePath() const; - protected: Network() : type_(TYPE_UNKNOWN), @@ -536,8 +532,8 @@ class NetworkLibrary { // Returns the current list of cellular networks. virtual const CellularNetworkVector& cellular_networks() const = 0; - // Search the list of networks by path and if the network is available, - // return a pointer to the network. + // Search the current list of networks by path and if the network + // is available, copy the result and return true. virtual WifiNetwork* FindWifiNetworkByPath(const std::string& path) = 0; virtual CellularNetwork* FindCellularNetworkByPath( const std::string& path) = 0; |