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

Unified Diff: chrome/browser/chromeos/login/helper.h

Issue 22264004: Remove ConnectivityStateHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove redundant IsConnected() check 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
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_controller.cc ('k') | chrome/browser/chromeos/login/helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/helper.h
diff --git a/chrome/browser/chromeos/login/helper.h b/chrome/browser/chromeos/login/helper.h
index 41bc75d9fce29252fe2fb78e2e7ee08c117cd1ef..543e6e5a88e03b0579c4370dcd5989537aefaf18 100644
--- a/chrome/browser/chromeos/login/helper.h
+++ b/chrome/browser/chromeos/login/helper.h
@@ -26,13 +26,6 @@ namespace chromeos {
// |size| is not empty. Otherwise the whole monitor is occupied.
gfx::Rect CalculateScreenBounds(const gfx::Size& size);
-// Returns name of the currently connected network.
-// If there are no connected networks, returns name of the network
-// that is in the "connecting" state. Otherwise empty string is returned.
-// If there are multiple connected networks, network priority:
-// Ethernet > WiFi > Cellular. Same for connecting network.
-string16 GetCurrentNetworkName();
-
// Returns the size of user image required for proper display under current DPI.
int GetCurrentUserImageSize();
@@ -44,6 +37,29 @@ namespace login {
// displayed under all possible DPI values.
const int kMaxUserImageSize = 512;
+// A helper class for easily mocking out Network*Handler calls for tests.
+class NetworkStateHelper {
+ public:
+ NetworkStateHelper();
+ virtual ~NetworkStateHelper();
+
+ // Returns name of the currently connected network.
+ // If there are no connected networks, returns name of the network
+ // that is in the "connecting" state. Otherwise empty string is returned.
+ // If there are multiple connected networks, network priority:
+ // Ethernet > WiFi > Cellular. Same for connecting network.
+ virtual string16 GetCurrentNetworkName() const;
+
+ // Returns true if the default network is in connected state.
+ virtual bool IsConnected() const;
+
+ // Returns true if the default network is in connecting state.
+ virtual bool IsConnecting() const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NetworkStateHelper);
+};
+
} // namespace login
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_controller.cc ('k') | chrome/browser/chromeos/login/helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698