Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: ash/system/chromeos/network/network_state_notifier.h

Issue 23075012: Update NetworkStateNotifier to use message_center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Track deafult_network and reset did_show_out_of_credits on any change Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/system/chromeos/network/network_state_notifier.h
diff --git a/ash/system/chromeos/network/network_state_notifier.h b/ash/system/chromeos/network/network_state_notifier.h
index 5e944c5a191ee947bb38e5f237a516fa9bbde732..612dfbfb1acb1f2cf432a43d3d6ac352c2fbb0c2 100644
--- a/ash/system/chromeos/network/network_state_notifier.h
+++ b/ash/system/chromeos/network/network_state_notifier.h
@@ -5,10 +5,9 @@
#ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_NOTIFIER_H_
#define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_STATE_NOTIFIER_H_
-#include <map>
+#include <set>
#include "ash/ash_export.h"
-#include "ash/system/chromeos/network/network_tray_delegate.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
@@ -34,8 +33,7 @@ namespace ash {
// 2. It observes NetworkState changes to generate notifications when a
// Cellular network is out of credits.
class ASH_EXPORT NetworkStateNotifier :
- public chromeos::NetworkStateHandlerObserver,
- public NetworkTrayDelegate {
+ public chromeos::NetworkStateHandlerObserver {
public:
NetworkStateNotifier();
virtual ~NetworkStateNotifier();
@@ -46,11 +44,6 @@ class ASH_EXPORT NetworkStateNotifier :
virtual void NetworkPropertiesUpdated(
const chromeos::NetworkState* network) OVERRIDE;
- // NetworkTrayDelegate
- virtual void NotificationLinkClicked(
- NetworkObserver::MessageType message_type,
- size_t link_index) OVERRIDE;
-
// Show a connection error notification. If |error_name| matches an error
// defined in NetworkConnectionHandler for connect, configure, or activation
// failed, then the associated message is shown, otherwise the Shill
@@ -74,10 +67,17 @@ class ASH_EXPORT NetworkStateNotifier :
const std::string& service_path,
const base::DictionaryValue& shill_properties);
- std::string last_active_network_;
- std::string cellular_network_;
- bool cellular_out_of_credits_;
+ // Returns true if the default network changed.
+ bool UpdateDefaultNetwork(const chromeos::NetworkState* network);
+
+ // Helper methods to update state and check for notifications.
+ void UpdateCellularOutOfCredits(const chromeos::NetworkState* cellular);
+ void UpdateCellularActivating(const chromeos::NetworkState* cellular);
+
+ std::string last_default_network_;
+ bool did_show_out_of_credits_;
base::Time out_of_credits_notify_time_;
+ std::set<std::string> cellular_activating_;
base::WeakPtrFactory<NetworkStateNotifier> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(NetworkStateNotifier);
« no previous file with comments | « ash/system/chromeos/network/network_observer.cc ('k') | ash/system/chromeos/network/network_state_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698