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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 14820030: Move Chrome OS switches to chromeos/chromeos_switches.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits Created 7 years, 7 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
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/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 28 matching lines...) Expand all
39 #include "chrome/browser/chromeos/status/network_menu_icon.h" 39 #include "chrome/browser/chromeos/status/network_menu_icon.h"
40 #include "chrome/browser/net/pref_proxy_config_tracker.h" 40 #include "chrome/browser/net/pref_proxy_config_tracker.h"
41 #include "chrome/browser/profiles/profile.h" 41 #include "chrome/browser/profiles/profile.h"
42 #include "chrome/browser/profiles/profile_manager.h" 42 #include "chrome/browser/profiles/profile_manager.h"
43 #include "chrome/browser/ui/browser.h" 43 #include "chrome/browser/ui/browser.h"
44 #include "chrome/browser/ui/browser_finder.h" 44 #include "chrome/browser/ui/browser_finder.h"
45 #include "chrome/browser/ui/browser_window.h" 45 #include "chrome/browser/ui/browser_window.h"
46 #include "chrome/browser/ui/host_desktop.h" 46 #include "chrome/browser/ui/host_desktop.h"
47 #include "chrome/browser/ui/singleton_tabs.h" 47 #include "chrome/browser/ui/singleton_tabs.h"
48 #include "chrome/common/chrome_notification_types.h" 48 #include "chrome/common/chrome_notification_types.h"
49 #include "chrome/common/chrome_switches.h"
50 #include "chrome/common/time_format.h" 49 #include "chrome/common/time_format.h"
50 #include "chromeos/chromeos_switches.h"
51 #include "chromeos/network/network_ip_config.h" 51 #include "chromeos/network/network_ip_config.h"
52 #include "chromeos/network/network_util.h" 52 #include "chromeos/network/network_util.h"
53 #include "chromeos/network/onc/onc_constants.h" 53 #include "chromeos/network/onc/onc_constants.h"
54 #include "content/public/browser/notification_service.h" 54 #include "content/public/browser/notification_service.h"
55 #include "content/public/browser/web_contents.h" 55 #include "content/public/browser/web_contents.h"
56 #include "content/public/browser/web_ui.h" 56 #include "content/public/browser/web_ui.h"
57 #include "grit/ash_resources.h" 57 #include "grit/ash_resources.h"
58 #include "grit/ash_strings.h" 58 #include "grit/ash_strings.h"
59 #include "grit/chromium_strings.h" 59 #include "grit/chromium_strings.h"
60 #include "grit/generated_resources.h" 60 #include "grit/generated_resources.h"
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 1340
1341 // Only show proxy for remembered networks. 1341 // Only show proxy for remembered networks.
1342 chromeos::NetworkProfileType network_profile = network->profile_type(); 1342 chromeos::NetworkProfileType network_profile = network->profile_type();
1343 dictionary.SetBoolean(kTagShowProxy, 1343 dictionary.SetBoolean(kTagShowProxy,
1344 network_profile != chromeos::PROFILE_NONE); 1344 network_profile != chromeos::PROFILE_NONE);
1345 1345
1346 // Enable static ip config for ethernet. For wifi, enable if flag is set. 1346 // Enable static ip config for ethernet. For wifi, enable if flag is set.
1347 bool staticIPConfig = type == chromeos::TYPE_ETHERNET || 1347 bool staticIPConfig = type == chromeos::TYPE_ETHERNET ||
1348 (type == chromeos::TYPE_WIFI && 1348 (type == chromeos::TYPE_WIFI &&
1349 CommandLine::ForCurrentProcess()->HasSwitch( 1349 CommandLine::ForCurrentProcess()->HasSwitch(
1350 switches::kEnableStaticIPConfig)); 1350 chromeos::switches::kEnableStaticIPConfig));
1351 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig); 1351 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig);
1352 1352
1353 dictionary.SetBoolean(kTagShowPreferred, 1353 dictionary.SetBoolean(kTagShowPreferred,
1354 network_profile == chromeos::PROFILE_USER); 1354 network_profile == chromeos::PROFILE_USER);
1355 SetValueDictionary(&dictionary, kTagPreferred, 1355 SetValueDictionary(&dictionary, kTagPreferred,
1356 new base::FundamentalValue(network->preferred()), 1356 new base::FundamentalValue(network->preferred()),
1357 property_ui_data); 1357 property_ui_data);
1358 1358
1359 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); 1359 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data);
1360 std::string onc_path_to_auto_connect; 1360 std::string onc_path_to_auto_connect;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 dictionary->SetString(kTagLocalizedName, apn.localized_name); 1456 dictionary->SetString(kTagLocalizedName, apn.localized_name);
1457 dictionary->SetString(kTagLanguage, apn.language); 1457 dictionary->SetString(kTagLanguage, apn.language);
1458 return dictionary; 1458 return dictionary;
1459 } 1459 }
1460 1460
1461 void InternetOptionsHandler::PopulateCellularDetails( 1461 void InternetOptionsHandler::PopulateCellularDetails(
1462 const chromeos::CellularNetwork* cellular, 1462 const chromeos::CellularNetwork* cellular,
1463 DictionaryValue* dictionary) { 1463 DictionaryValue* dictionary) {
1464 dictionary->SetBoolean(kTagCarrierSelectFlag, 1464 dictionary->SetBoolean(kTagCarrierSelectFlag,
1465 CommandLine::ForCurrentProcess()->HasSwitch( 1465 CommandLine::ForCurrentProcess()->HasSwitch(
1466 switches::kEnableCarrierSwitching)); 1466 chromeos::switches::kEnableCarrierSwitching));
1467 // Cellular network / connection settings. 1467 // Cellular network / connection settings.
1468 dictionary->SetString(kTagServiceName, cellular->name()); 1468 dictionary->SetString(kTagServiceName, cellular->name());
1469 dictionary->SetString(kTagNetworkTechnology, 1469 dictionary->SetString(kTagNetworkTechnology,
1470 cellular->GetNetworkTechnologyString()); 1470 cellular->GetNetworkTechnologyString());
1471 dictionary->SetString(kTagOperatorName, cellular->operator_name()); 1471 dictionary->SetString(kTagOperatorName, cellular->operator_name());
1472 dictionary->SetString(kTagOperatorCode, cellular->operator_code()); 1472 dictionary->SetString(kTagOperatorCode, cellular->operator_code());
1473 dictionary->SetString(kTagActivationState, 1473 dictionary->SetString(kTagActivationState,
1474 cellular->GetActivationStateString()); 1474 cellular->GetActivationStateString());
1475 dictionary->SetString(kTagRoamingState, 1475 dictionary->SetString(kTagRoamingState,
1476 cellular->GetRoamingStateString()); 1476 cellular->GetRoamingStateString());
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 const chromeos::CellularApnList& apn_list = device->provider_apn_list(); 1526 const chromeos::CellularApnList& apn_list = device->provider_apn_list();
1527 ListValue* apn_list_value = new ListValue(); 1527 ListValue* apn_list_value = new ListValue();
1528 for (chromeos::CellularApnList::const_iterator it = apn_list.begin(); 1528 for (chromeos::CellularApnList::const_iterator it = apn_list.begin();
1529 it != apn_list.end(); ++it) { 1529 it != apn_list.end(); ++it) {
1530 apn_list_value->Append(CreateDictionaryFromCellularApn(*it)); 1530 apn_list_value->Append(CreateDictionaryFromCellularApn(*it));
1531 } 1531 }
1532 SetValueDictionary(dictionary, kTagProviderApnList, apn_list_value, 1532 SetValueDictionary(dictionary, kTagProviderApnList, apn_list_value,
1533 cellular_property_ui_data); 1533 cellular_property_ui_data);
1534 1534
1535 if (CommandLine::ForCurrentProcess()->HasSwitch( 1535 if (CommandLine::ForCurrentProcess()->HasSwitch(
1536 switches::kEnableCarrierSwitching)) { 1536 chromeos::switches::kEnableCarrierSwitching)) {
1537 base::ListValue* supported_carriers = device->supported_carriers(); 1537 base::ListValue* supported_carriers = device->supported_carriers();
1538 if (supported_carriers) { 1538 if (supported_carriers) {
1539 dictionary->Set(kTagCarriers, supported_carriers->DeepCopy()); 1539 dictionary->Set(kTagCarriers, supported_carriers->DeepCopy());
1540 dictionary->SetInteger(kTagCurrentCarrierIndex, 1540 dictionary->SetInteger(kTagCurrentCarrierIndex,
1541 FindCurrentCarrierIndex(supported_carriers, 1541 FindCurrentCarrierIndex(supported_carriers,
1542 device)); 1542 device));
1543 } else { 1543 } else {
1544 // In case of any error, set the current carrier tag to -1 indicating 1544 // In case of any error, set the current carrier tag to -1 indicating
1545 // to the JS code to fallback to a single carrier. 1545 // to the JS code to fallback to a single carrier.
1546 dictionary->SetInteger(kTagCurrentCarrierIndex, -1); 1546 dictionary->SetInteger(kTagCurrentCarrierIndex, -1);
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 1863
1864 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); 1864 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled());
1865 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); 1865 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available());
1866 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); 1866 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy());
1867 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once 1867 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once
1868 // we have proper back-end support. 1868 // we have proper back-end support.
1869 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); 1869 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode());
1870 } 1870 }
1871 1871
1872 } // namespace options 1872 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698