| 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..5e944c5a191ee947bb38e5f237a516fa9bbde732 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(
|
| @@ -52,18 +51,34 @@ class ASH_EXPORT NetworkStateNotifier :
|
| NetworkObserver::MessageType message_type,
|
| size_t link_index) OVERRIDE;
|
|
|
| - // Show a connection error notification.
|
| + // 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
|
| + // error for Service.Error is used (from network_connect::ErrorString), or
|
| + // "Unknown network error".
|
| void ShowNetworkConnectError(const std::string& error_name,
|
| const std::string& service_path);
|
|
|
| private:
|
| - typedef std::map<std::string, std::string> CachedStateMap;
|
| + void ConnectErrorPropertiesSucceeded(
|
| + 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);
|
|
|
| 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);
|
| };
|
|
|