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

Unified Diff: chrome/browser/chromeos/cros/network_library.h

Issue 10554013: Add a CONNECT_REQUESTED state to Network ConnectionState. (Closed) Base URL: http://git.chromium.org/git/chromium/src@master
Patch Set: Fix tests Created 8 years, 6 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: chrome/browser/chromeos/cros/network_library.h
diff --git a/chrome/browser/chromeos/cros/network_library.h b/chrome/browser/chromeos/cros/network_library.h
index 7df2a9f859ce9d2afb8d6dbd981a8ccd23eb496e..ead2f1bd133449fb512ccc27eb07bdc0b91ae1a4 100644
--- a/chrome/browser/chromeos/cros/network_library.h
+++ b/chrome/browser/chromeos/cros/network_library.h
@@ -299,11 +299,14 @@ class Network {
class TestApi {
public:
explicit TestApi(Network* network) : network_(network) {}
- void SetConnected(bool connected) {
- network_->set_connected(connected);
+ void SetConnected() {
+ network_->set_connected();
}
- void SetConnecting(bool connecting) {
- network_->set_connecting(connecting);
+ void SetConnecting() {
+ network_->set_connecting();
+ }
+ void SetDisconnected() {
+ network_->set_idle();
}
private:
Network* network_;
@@ -407,7 +410,8 @@ class Network {
state == STATE_PORTAL);
}
static bool IsConnectingState(ConnectionState state) {
- return (state == STATE_ASSOCIATION ||
+ return (state == STATE_CONNECT_REQUESTED ||
+ state == STATE_ASSOCIATION ||
state == STATE_CONFIGURATION ||
state == STATE_CARRIER);
}
@@ -520,11 +524,14 @@ class Network {
}
void set_name(const std::string& name) { name_ = name; }
void set_mode(ConnectionMode mode) { mode_ = mode; }
- void set_connecting(bool connecting) {
- state_ = (connecting ? STATE_ASSOCIATION : STATE_IDLE);
+ void set_connecting() {
+ state_ = STATE_CONNECT_REQUESTED;
+ }
+ void set_connected() {
+ state_ = STATE_ONLINE;
}
- void set_connected(bool connected) {
- state_ = (connected ? STATE_ONLINE : STATE_IDLE);
+ void set_idle() {
Greg Spencer (Chromium) 2012/06/18 17:02:38 Any reason this shouldn't be called "set_disconnec
stevenjb (google-dont-use) 2012/06/18 17:35:31 Done. The UI doesn't currently care about a "disco
+ state_ = STATE_IDLE;
}
void set_connectable(bool connectable) { connectable_ = connectable; }
void set_connection_started(bool started) { connection_started_ = started; }

Powered by Google App Engine
This is Rietveld 408576698