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

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc

Issue 10175010: Force a rescan when opening the Wifi menu on the settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h" 5 #include "chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 426
427 FillNetworkInfo(localized_strings); 427 FillNetworkInfo(localized_strings);
428 } 428 }
429 429
430 void InternetOptionsHandler::InitializePage() { 430 void InternetOptionsHandler::InitializePage() {
431 cros_->RequestNetworkScan(); 431 cros_->RequestNetworkScan();
432 } 432 }
433 433
434 void InternetOptionsHandler::RegisterMessages() { 434 void InternetOptionsHandler::RegisterMessages() {
435 // Setup handlers specific to this panel. 435 // Setup handlers specific to this panel.
436 web_ui()->RegisterMessageCallback("refreshNetworks",
437 base::Bind(&InternetOptionsHandler::RefreshNetworksCallback,
438 base::Unretained(this)));
436 web_ui()->RegisterMessageCallback("buttonClickCallback", 439 web_ui()->RegisterMessageCallback("buttonClickCallback",
437 base::Bind(&InternetOptionsHandler::ButtonClickCallback, 440 base::Bind(&InternetOptionsHandler::ButtonClickCallback,
438 base::Unretained(this))); 441 base::Unretained(this)));
439 web_ui()->RegisterMessageCallback("refreshCellularPlan", 442 web_ui()->RegisterMessageCallback("refreshCellularPlan",
440 base::Bind(&InternetOptionsHandler::RefreshCellularPlanCallback, 443 base::Bind(&InternetOptionsHandler::RefreshCellularPlanCallback,
441 base::Unretained(this))); 444 base::Unretained(this)));
442 web_ui()->RegisterMessageCallback("setPreferNetwork", 445 web_ui()->RegisterMessageCallback("setPreferNetwork",
443 base::Bind(&InternetOptionsHandler::SetPreferNetworkCallback, 446 base::Bind(&InternetOptionsHandler::SetPreferNetworkCallback,
444 base::Unretained(this))); 447 base::Unretained(this)));
445 web_ui()->RegisterMessageCallback("setAutoConnect", 448 web_ui()->RegisterMessageCallback("setAutoConnect",
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 else 572 else
570 mode = chromeos::SimDialogDelegate::SIM_DIALOG_SET_LOCK_OFF; 573 mode = chromeos::SimDialogDelegate::SIM_DIALOG_SET_LOCK_OFF;
571 chromeos::SimDialogDelegate::ShowDialog(GetNativeWindow(), mode); 574 chromeos::SimDialogDelegate::ShowDialog(GetNativeWindow(), mode);
572 } 575 }
573 576
574 void InternetOptionsHandler::ChangePinCallback(const ListValue* args) { 577 void InternetOptionsHandler::ChangePinCallback(const ListValue* args) {
575 chromeos::SimDialogDelegate::ShowDialog(GetNativeWindow(), 578 chromeos::SimDialogDelegate::ShowDialog(GetNativeWindow(),
576 chromeos::SimDialogDelegate::SIM_DIALOG_CHANGE_PIN); 579 chromeos::SimDialogDelegate::SIM_DIALOG_CHANGE_PIN);
577 } 580 }
578 581
582 void InternetOptionsHandler::RefreshNetworksCallback(const ListValue* args) {
583 cros_->RequestNetworkScan();
584 }
585
579 void InternetOptionsHandler::RefreshNetworkData() { 586 void InternetOptionsHandler::RefreshNetworkData() {
580 DictionaryValue dictionary; 587 DictionaryValue dictionary;
581 FillNetworkInfo(&dictionary); 588 FillNetworkInfo(&dictionary);
582 web_ui()->CallJavascriptFunction( 589 web_ui()->CallJavascriptFunction(
583 "options.network.NetworkList.refreshNetworkData", dictionary); 590 "options.network.NetworkList.refreshNetworkData", dictionary);
584 } 591 }
585 592
586 void InternetOptionsHandler::OnNetworkManagerChanged( 593 void InternetOptionsHandler::OnNetworkManagerChanged(
587 chromeos::NetworkLibrary* cros) { 594 chromeos::NetworkLibrary* cros) {
588 if (!web_ui()) 595 if (!web_ui())
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 if (default_value) 1287 if (default_value)
1281 value_dict->Set("default", default_value->DeepCopy()); 1288 value_dict->Set("default", default_value->DeepCopy());
1282 if (ui_data.managed()) 1289 if (ui_data.managed())
1283 value_dict->SetString("controlledBy", "policy"); 1290 value_dict->SetString("controlledBy", "policy");
1284 else if (ui_data.recommended()) 1291 else if (ui_data.recommended())
1285 value_dict->SetString("controlledBy", "recommended"); 1292 value_dict->SetString("controlledBy", "recommended");
1286 settings->Set(key, value_dict); 1293 settings->Set(key, value_dict);
1287 } 1294 }
1288 1295
1289 } // namespace options2 1296 } // namespace options2
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698