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

Unified Diff: chrome/browser/ui/webui/chromeos/login/network_dropdown.cc

Issue 10692111: Added forced network scan to network dropdown. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added comment to NetworkDropdown::ForceNetworkScan Created 8 years, 5 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/ui/webui/chromeos/login/network_dropdown.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/network_dropdown.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc b/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc
index 58cc41bac059de2baf31cfd2e10f15a044d47974..643280e3618d5526dede7255bbfa18caa97a6c1e 100644
--- a/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc
+++ b/chrome/browser/ui/webui/chromeos/login/network_dropdown.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "base/time.h"
#include "base/values.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/login/base_login_display_host.h"
@@ -16,6 +17,14 @@
#include "ui/gfx/font.h"
#include "ui/gfx/image/image_skia.h"
+namespace {
+
+// Timeout between consecutive requests to network library for network
+// scan.
+const int kNetworkScanIntervalSecs = 60;
+
+} // namespace
+
namespace chromeos {
// WebUI specific implementation of the NetworkMenu class.
@@ -107,6 +116,9 @@ NetworkDropdown::NetworkDropdown(content::WebUI* web_ui,
CrosLibrary::Get()->GetNetworkLibrary()->AddNetworkManagerObserver(this);
CrosLibrary::Get()->GetNetworkLibrary()->RequestNetworkScan();
Refresh();
+ network_scan_timer_.Start(FROM_HERE,
+ base::TimeDelta::FromSeconds(kNetworkScanIntervalSecs),
+ this, &NetworkDropdown::ForceNetworkScan);
}
NetworkDropdown::~NetworkDropdown() {
@@ -160,4 +172,9 @@ void NetworkDropdown::SetNetworkIconAndText() {
title, icon);
}
+void NetworkDropdown::ForceNetworkScan() {
+ CrosLibrary::Get()->GetNetworkLibrary()->RequestNetworkScan();
+ Refresh();
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/network_dropdown.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698