OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 33 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
34 #include "chrome/browser/chromeos/mobile_config.h" | 34 #include "chrome/browser/chromeos/mobile_config.h" |
35 #include "chrome/browser/chromeos/options/network_config_view.h" | 35 #include "chrome/browser/chromeos/options/network_config_view.h" |
36 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 36 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
37 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 37 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
38 #include "chrome/browser/chromeos/status/network_menu_icon.h" | 38 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
39 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 39 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
40 #include "chrome/browser/profiles/profile.h" | 40 #include "chrome/browser/profiles/profile.h" |
41 #include "chrome/browser/profiles/profile_manager.h" | 41 #include "chrome/browser/profiles/profile_manager.h" |
42 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
43 #include "chrome/browser/ui/browser_list.h" | 43 #include "chrome/browser/ui/browser_finder.h" |
44 #include "chrome/browser/ui/browser_window.h" | 44 #include "chrome/browser/ui/browser_window.h" |
45 #include "chrome/browser/ui/webui/web_ui_util.h" | 45 #include "chrome/browser/ui/webui/web_ui_util.h" |
46 #include "chrome/common/chrome_notification_types.h" | 46 #include "chrome/common/chrome_notification_types.h" |
47 #include "chrome/common/chrome_switches.h" | 47 #include "chrome/common/chrome_switches.h" |
48 #include "chrome/common/time_format.h" | 48 #include "chrome/common/time_format.h" |
49 #include "content/public/browser/notification_service.h" | 49 #include "content/public/browser/notification_service.h" |
50 #include "content/public/browser/web_ui.h" | 50 #include "content/public/browser/web_ui.h" |
51 #include "grit/chromium_strings.h" | 51 #include "grit/chromium_strings.h" |
52 #include "grit/generated_resources.h" | 52 #include "grit/generated_resources.h" |
53 #include "grit/locale_settings.h" | 53 #include "grit/locale_settings.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) { | 537 void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) { |
538 cros_->EnableCellularNetworkDevice(false); | 538 cros_->EnableCellularNetworkDevice(false); |
539 } | 539 } |
540 | 540 |
541 void InternetOptionsHandler::ShowMorePlanInfoCallback(const ListValue* args) { | 541 void InternetOptionsHandler::ShowMorePlanInfoCallback(const ListValue* args) { |
542 if (!web_ui()) | 542 if (!web_ui()) |
543 return; | 543 return; |
544 Browser* browser = BrowserList::FindBrowserWithFeature( | 544 Browser* browser = browser::FindBrowserWithFeature( |
545 Profile::FromWebUI(web_ui()), Browser::FEATURE_TABSTRIP); | 545 Profile::FromWebUI(web_ui()), Browser::FEATURE_TABSTRIP); |
546 if (!browser) | 546 if (!browser) |
547 return; | 547 return; |
548 | 548 |
549 const chromeos::CellularNetwork* cellular = cros_->cellular_network(); | 549 const chromeos::CellularNetwork* cellular = cros_->cellular_network(); |
550 if (!cellular) | 550 if (!cellular) |
551 return; | 551 return; |
552 | 552 |
553 browser->OpenURL(content::OpenURLParams( | 553 browser->OpenURL(content::OpenURLParams( |
554 cellular->GetAccountInfoUrl(), content::Referrer(), | 554 cellular->GetAccountInfoUrl(), content::Referrer(), |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 views::Widget* window = views::Widget::CreateWindowWithParent( | 1057 views::Widget* window = views::Widget::CreateWindowWithParent( |
1058 view, GetNativeWindow()); | 1058 view, GetNativeWindow()); |
1059 window->SetAlwaysOnTop(true); | 1059 window->SetAlwaysOnTop(true); |
1060 window->Show(); | 1060 window->Show(); |
1061 } | 1061 } |
1062 | 1062 |
1063 gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const { | 1063 gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const { |
1064 // TODO(beng): This is an improper direct dependency on Browser. Route this | 1064 // TODO(beng): This is an improper direct dependency on Browser. Route this |
1065 // through some sort of delegate. | 1065 // through some sort of delegate. |
1066 Browser* browser = | 1066 Browser* browser = |
1067 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui())); | 1067 browser::FindBrowserWithProfile(Profile::FromWebUI(web_ui())); |
1068 return browser->window()->GetNativeHandle(); | 1068 return browser->window()->GetNativeHandle(); |
1069 } | 1069 } |
1070 | 1070 |
1071 Browser* InternetOptionsHandler::GetAppropriateBrowser() { | 1071 Browser* InternetOptionsHandler::GetAppropriateBrowser() { |
1072 return Browser::GetOrCreateTabbedBrowser( | 1072 return browser::FindOrCreateTabbedBrowser( |
1073 ProfileManager::GetDefaultProfileOrOffTheRecord()); | 1073 ProfileManager::GetDefaultProfileOrOffTheRecord()); |
1074 } | 1074 } |
1075 | 1075 |
1076 void InternetOptionsHandler::NetworkCommandCallback(const ListValue* args) { | 1076 void InternetOptionsHandler::NetworkCommandCallback(const ListValue* args) { |
1077 std::string str_type; | 1077 std::string str_type; |
1078 std::string service_path; | 1078 std::string service_path; |
1079 std::string command; | 1079 std::string command; |
1080 if (args->GetSize() != 3 || | 1080 if (args->GetSize() != 3 || |
1081 !args->GetString(0, &str_type) || | 1081 !args->GetString(0, &str_type) || |
1082 !args->GetString(1, &service_path) || | 1082 !args->GetString(1, &service_path) || |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 if (default_value) | 1351 if (default_value) |
1352 value_dict->Set("default", default_value->DeepCopy()); | 1352 value_dict->Set("default", default_value->DeepCopy()); |
1353 if (ui_data.managed()) | 1353 if (ui_data.managed()) |
1354 value_dict->SetString("controlledBy", "policy"); | 1354 value_dict->SetString("controlledBy", "policy"); |
1355 else if (ui_data.recommended()) | 1355 else if (ui_data.recommended()) |
1356 value_dict->SetString("controlledBy", "recommended"); | 1356 value_dict->SetString("controlledBy", "recommended"); |
1357 settings->Set(key, value_dict); | 1357 settings->Set(key, value_dict); |
1358 } | 1358 } |
1359 | 1359 |
1360 } // namespace options2 | 1360 } // namespace options2 |
OLD | NEW |