| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/options/chromeos/internet_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.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 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/chromeos/choose_mobile_network_dialog.h" | 23 #include "chrome/browser/chromeos/choose_mobile_network_dialog.h" |
| 24 #include "chrome/browser/chromeos/cros/cros_library.h" | 24 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 25 #include "chrome/browser/chromeos/cros_settings.h" | 25 #include "chrome/browser/chromeos/cros_settings.h" |
| 26 #include "chrome/browser/chromeos/customization_document.h" | 26 #include "chrome/browser/chromeos/customization_document.h" |
| 27 #include "chrome/browser/chromeos/login/user_manager.h" | 27 #include "chrome/browser/chromeos/login/user_manager.h" |
| 28 #include "chrome/browser/chromeos/options/network_config_view.h" | 28 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 29 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 29 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
| 30 #include "chrome/browser/chromeos/status/network_menu_icon.h" | 30 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
| 31 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 31 #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
| 32 #include "chrome/browser/prefs/pref_service.h" | 32 #include "chrome/browser/prefs/pref_service.h" |
| 33 #include "chrome/browser/profiles/profile.h" |
| 33 #include "chrome/browser/ui/browser.h" | 34 #include "chrome/browser/ui/browser.h" |
| 34 #include "chrome/browser/ui/browser_list.h" | 35 #include "chrome/browser/ui/browser_list.h" |
| 35 #include "chrome/browser/ui/browser_window.h" | 36 #include "chrome/browser/ui/browser_window.h" |
| 36 #include "chrome/browser/ui/views/window.h" | 37 #include "chrome/browser/ui/views/window.h" |
| 37 #include "chrome/browser/ui/webui/web_ui_util.h" | 38 #include "chrome/browser/ui/webui/web_ui_util.h" |
| 38 #include "chrome/common/chrome_notification_types.h" | 39 #include "chrome/common/chrome_notification_types.h" |
| 39 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 40 #include "chrome/common/time_format.h" | 41 #include "chrome/common/time_format.h" |
| 41 #include "content/common/notification_service.h" | 42 #include "content/common/notification_service.h" |
| 42 #include "grit/chromium_strings.h" | 43 #include "grit/chromium_strings.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 412 } |
| 412 | 413 |
| 413 void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) { | 414 void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) { |
| 414 cros_->EnableCellularNetworkDevice(false); | 415 cros_->EnableCellularNetworkDevice(false); |
| 415 } | 416 } |
| 416 | 417 |
| 417 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) { | 418 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) { |
| 418 if (!web_ui_) | 419 if (!web_ui_) |
| 419 return; | 420 return; |
| 420 Browser* browser = BrowserList::FindBrowserWithFeature( | 421 Browser* browser = BrowserList::FindBrowserWithFeature( |
| 421 web_ui_->GetProfile(), Browser::FEATURE_TABSTRIP); | 422 Profile::FromWebUI(web_ui_), Browser::FEATURE_TABSTRIP); |
| 422 if (browser) | 423 if (browser) |
| 423 browser->OpenMobilePlanTabAndActivate(); | 424 browser->OpenMobilePlanTabAndActivate(); |
| 424 } | 425 } |
| 425 | 426 |
| 426 void InternetOptionsHandler::SetApnCallback(const ListValue* args) { | 427 void InternetOptionsHandler::SetApnCallback(const ListValue* args) { |
| 427 std::string service_path; | 428 std::string service_path; |
| 428 std::string apn; | 429 std::string apn; |
| 429 std::string username; | 430 std::string username; |
| 430 std::string password; | 431 std::string password; |
| 431 if (args->GetSize() != 4 || | 432 if (args->GetSize() != 4 || |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 | 880 |
| 880 void InternetOptionsHandler::CreateModalPopup(views::WidgetDelegate* view) { | 881 void InternetOptionsHandler::CreateModalPopup(views::WidgetDelegate* view) { |
| 881 views::Widget* window = browser::CreateViewsWindow(GetNativeWindow(), view); | 882 views::Widget* window = browser::CreateViewsWindow(GetNativeWindow(), view); |
| 882 window->SetAlwaysOnTop(true); | 883 window->SetAlwaysOnTop(true); |
| 883 window->Show(); | 884 window->Show(); |
| 884 } | 885 } |
| 885 | 886 |
| 886 gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const { | 887 gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const { |
| 887 // TODO(beng): This is an improper direct dependency on Browser. Route this | 888 // TODO(beng): This is an improper direct dependency on Browser. Route this |
| 888 // through some sort of delegate. | 889 // through some sort of delegate. |
| 889 Browser* browser = BrowserList::FindBrowserWithProfile(web_ui_->GetProfile()); | 890 Browser* browser = |
| 891 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui_)); |
| 890 return browser->window()->GetNativeHandle(); | 892 return browser->window()->GetNativeHandle(); |
| 891 } | 893 } |
| 892 | 894 |
| 893 void InternetOptionsHandler::ButtonClickCallback(const ListValue* args) { | 895 void InternetOptionsHandler::ButtonClickCallback(const ListValue* args) { |
| 894 std::string str_type; | 896 std::string str_type; |
| 895 std::string service_path; | 897 std::string service_path; |
| 896 std::string command; | 898 std::string command; |
| 897 if (args->GetSize() != 3 || | 899 if (args->GetSize() != 3 || |
| 898 !args->GetString(0, &str_type) || | 900 !args->GetString(0, &str_type) || |
| 899 !args->GetString(1, &service_path) || | 901 !args->GetString(1, &service_path) || |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 dictionary->SetBoolean("accessLocked", cros_->IsLocked()); | 1268 dictionary->SetBoolean("accessLocked", cros_->IsLocked()); |
| 1267 dictionary->Set("wiredList", GetWiredList()); | 1269 dictionary->Set("wiredList", GetWiredList()); |
| 1268 dictionary->Set("wirelessList", GetWirelessList()); | 1270 dictionary->Set("wirelessList", GetWirelessList()); |
| 1269 dictionary->Set("vpnList", GetVPNList()); | 1271 dictionary->Set("vpnList", GetVPNList()); |
| 1270 dictionary->Set("rememberedList", GetRememberedList()); | 1272 dictionary->Set("rememberedList", GetRememberedList()); |
| 1271 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available()); | 1273 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available()); |
| 1272 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled()); | 1274 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled()); |
| 1273 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available()); | 1275 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available()); |
| 1274 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled()); | 1276 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled()); |
| 1275 } | 1277 } |
| OLD | NEW |