Commit e5461233 authored by kevers@chromium.org's avatar kevers@chromium.org

Force a rescan when opening the Wifi menu on the settings page.

BUG=123030
TEST=Manual.


Review URL: http://codereview.chromium.org/10175010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133820 0039d316-1c4b-4281-b951-d872f2087c98
parent 671b613a
......@@ -305,6 +305,11 @@ cr.define('options.network', function() {
*/
showMenu: function() {
var rebuild = false;
// Force a rescan if opening the menu for WiFi networks to ensure the
// list is up to date. Networks are periodically rescanned, but depending
// on timing, there could be an excessive delay before the first rescan
// unless forced.
var rescan = !activeMenu_ && this.data_.key == 'wifi';
if (!this.menu_) {
rebuild = true;
var existing = $(this.getMenuName_());
......@@ -329,6 +334,8 @@ cr.define('options.network', function() {
this.menu_.style.setProperty('top', top + 'px');
this.menu_.hidden = false;
}
if (rescan)
chrome.send('refreshNetworks');
},
};
......
......@@ -442,6 +442,9 @@ void InternetOptionsHandler::InitializePage() {
void InternetOptionsHandler::RegisterMessages() {
// Setup handlers specific to this panel.
web_ui()->RegisterMessageCallback("refreshNetworks",
base::Bind(&InternetOptionsHandler::RefreshNetworksCallback,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("buttonClickCallback",
base::Bind(&InternetOptionsHandler::ButtonClickCallback,
base::Unretained(this)));
......@@ -585,6 +588,10 @@ void InternetOptionsHandler::ChangePinCallback(const ListValue* args) {
chromeos::SimDialogDelegate::SIM_DIALOG_CHANGE_PIN);
}
void InternetOptionsHandler::RefreshNetworksCallback(const ListValue* args) {
cros_->RequestNetworkScan();
}
void InternetOptionsHandler::RefreshNetworkData() {
DictionaryValue dictionary;
FillNetworkInfo(&dictionary);
......
......@@ -95,7 +95,8 @@ class InternetOptionsHandler
void SetSimCardLockCallback(const base::ListValue* args);
void ChangePinCallback(const base::ListValue* args);
void ShareNetworkCallback(const base::ListValue* args);
void ShowMorePlanInfoCallback(const ListValue* args);
void ShowMorePlanInfoCallback(const base::ListValue* args);
void RefreshNetworksCallback(const base::ListValue* args);
/**
* Toggle airplane mode. Disables all wireless networks when activated.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment