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

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

Issue 22796014: Eliminate c/b/chromeos/options/network_connect.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix clang 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 30a41b35a60a00ecdbbcb8eb2cfa2e7c25c9ef30..8169a6f2087eed5bab74b1fcfd77f9b1b59fd5b2 100644
--- a/ash/system/chromeos/network/network_state_notifier.h
+++ b/ash/system/chromeos/network/network_state_notifier.h
@@ -11,9 +11,15 @@
#include "ash/system/chromeos/network/network_tray_delegate.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "chromeos/network/network_state_handler_observer.h"
+namespace base {
+class DictionaryValue;
+}
+
namespace chromeos {
class NetworkState;
}
@@ -23,14 +29,8 @@ namespace ash {
// This class has two purposes:
// 1. ShowNetworkConnectError() gets called after any user initiated connect
// failure. This will handle displaying an error notification.
-// NOTE: Because Shill sets the Error property of a Service *after*
-// the Connect call fails, this class will delay the notification if
-// necessary until the Error property is set so that the correct
-// message can be displayed.
// TODO(stevenjb): convert this class to use the new MessageCenter
-// notification system, generate a notification immediately, and update
-// it when the Error property is set to guarantee that a notification is
-// displayed for every failure.
+// notification system.
// 2. It observes NetworkState changes to generate notifications when a
// Cellular network is out of credits.
class ASH_EXPORT NetworkStateNotifier :
@@ -41,7 +41,6 @@ class ASH_EXPORT NetworkStateNotifier :
virtual ~NetworkStateNotifier();
// NetworkStateHandlerObserver
- virtual void NetworkListChanged() OVERRIDE;
virtual void DefaultNetworkChanged(
const chromeos::NetworkState* network) OVERRIDE;
virtual void NetworkPropertiesUpdated(
@@ -55,15 +54,28 @@ class ASH_EXPORT NetworkStateNotifier :
// Show a connection error notification.
void ShowNetworkConnectError(const std::string& error_name,
pneubeck (no reviews) 2013/08/20 08:32:26 what strings are allowed for |error_name| ?
stevenjb 2013/08/20 20:47:43 Documented.
const std::string& service_path);
+ void ConnectErrorPropertiesSucceeded(
pneubeck (no reviews) 2013/08/20 08:32:26 these three should be private?
stevenjb 2013/08/20 20:47:43 Done.
+ const std::string& error_name,
+ const std::string& service_path,
+ const base::DictionaryValue& shill_properties);
+ void ConnectErrorPropertiesFailed(
+ const std::string& error_name,
+ const std::string& service_path,
+ const std::string& shill_error_name,
+ scoped_ptr<base::DictionaryValue> shill_error_data);
+ void ShowConnectErrorNotification(
+ const std::string& error_name,
+ const std::string& service_path,
+ const base::DictionaryValue& shill_properties);
private:
typedef std::map<std::string, std::string> CachedStateMap;
std::string last_active_network_;
std::string cellular_network_;
- std::string connect_failed_network_;
bool cellular_out_of_credits_;
base::Time out_of_credits_notify_time_;
+ base::WeakPtrFactory<NetworkStateNotifier> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(NetworkStateNotifier);
};

Powered by Google App Engine
This is Rietveld 408576698