summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 18:53:14 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 18:53:14 +0000
commita0c9588e2891df0a68e474cab6f7b38616372e69 (patch)
tree608e6df782203cc9057e7672b6eed98f563991cd
parentebc1dea7ab6f535eac8db6de630d7c509d57b6d8 (diff)
downloadchromium_src-a0c9588e2891df0a68e474cab6f7b38616372e69.zip
chromium_src-a0c9588e2891df0a68e474cab6f7b38616372e69.tar.gz
chromium_src-a0c9588e2891df0a68e474cab6f7b38616372e69.tar.bz2
Move NetworkLoginObserver observer management to NetworkLibraryImplBase.
BUG=134685 TEST=No more crashes in ~NetowrkLoginObserver Review URL: https://chromiumcodereview.appspot.com/10684002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144500 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/cros/network_library_impl_base.cc3
-rw-r--r--chrome/browser/chromeos/network_login_observer.cc5
-rw-r--r--chrome/browser/chromeos/network_login_observer.h4
3 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/cros/network_library_impl_base.cc b/chrome/browser/chromeos/cros/network_library_impl_base.cc
index 42f81d9..4f38eb8 100644
--- a/chrome/browser/chromeos/cros/network_library_impl_base.cc
+++ b/chrome/browser/chromeos/cros/network_library_impl_base.cc
@@ -62,7 +62,8 @@ NetworkLibraryImplBase::NetworkLibraryImplBase()
is_locked_(false),
sim_operation_(SIM_OPERATION_NONE),
ALLOW_THIS_IN_INITIALIZER_LIST(notify_manager_weak_factory_(this)) {
- network_login_observer_.reset(new NetworkLoginObserver(this));
+ network_login_observer_.reset(new NetworkLoginObserver());
+ AddNetworkManagerObserver(network_login_observer_.get());
}
NetworkLibraryImplBase::~NetworkLibraryImplBase() {
diff --git a/chrome/browser/chromeos/network_login_observer.cc b/chrome/browser/chromeos/network_login_observer.cc
index 1d96a69..a82bd24 100644
--- a/chrome/browser/chromeos/network_login_observer.cc
+++ b/chrome/browser/chromeos/network_login_observer.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/chromeos/network_login_observer.h"
-#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/network_library.h"
#include "chrome/browser/chromeos/options/network_config_view.h"
#include "ui/views/widget/widget.h"
@@ -12,12 +11,10 @@
namespace chromeos {
-NetworkLoginObserver::NetworkLoginObserver(NetworkLibrary* netlib) {
- netlib->AddNetworkManagerObserver(this);
+NetworkLoginObserver::NetworkLoginObserver() {
}
NetworkLoginObserver::~NetworkLoginObserver() {
- CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this);
}
void NetworkLoginObserver::OnNetworkManagerChanged(NetworkLibrary* cros) {
diff --git a/chrome/browser/chromeos/network_login_observer.h b/chrome/browser/chromeos/network_login_observer.h
index 0867c78..9d04d88 100644
--- a/chrome/browser/chromeos/network_login_observer.h
+++ b/chrome/browser/chromeos/network_login_observer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -23,7 +23,7 @@ namespace chromeos {
class NetworkLoginObserver : public NetworkLibrary::NetworkManagerObserver {
public:
- explicit NetworkLoginObserver(NetworkLibrary* netlib);
+ NetworkLoginObserver();
virtual ~NetworkLoginObserver();
typedef std::map<std::string, bool> NetworkFailureMap;