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/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 | 1258 |
1259 chromeos::accessibility::EnableHighContrast(enabled); | 1259 chromeos::accessibility::EnableHighContrast(enabled); |
1260 } | 1260 } |
1261 | 1261 |
1262 void BrowserOptionsHandler::ScreenMagnifierChangeCallback( | 1262 void BrowserOptionsHandler::ScreenMagnifierChangeCallback( |
1263 const ListValue* args) { | 1263 const ListValue* args) { |
1264 std::string type_name; | 1264 std::string type_name; |
1265 args->GetString(0, &type_name); | 1265 args->GetString(0, &type_name); |
1266 | 1266 |
1267 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1267 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1268 user_pref_service->SetString(prefs::kScreenMagnifierType, | 1268 user_pref_service->SetString(prefs::kMagnifierType, |
1269 type_name); | 1269 type_name); |
1270 } | 1270 } |
1271 | 1271 |
1272 void BrowserOptionsHandler::VirtualKeyboardChangeCallback( | 1272 void BrowserOptionsHandler::VirtualKeyboardChangeCallback( |
1273 const ListValue* args) { | 1273 const ListValue* args) { |
1274 bool enabled = false; | 1274 bool enabled = false; |
1275 args->GetBoolean(0, &enabled); | 1275 args->GetBoolean(0, &enabled); |
1276 | 1276 |
1277 chromeos::accessibility::EnableVirtualKeyboard(enabled); | 1277 chromeos::accessibility::EnableVirtualKeyboard(enabled); |
1278 } | 1278 } |
(...skipping 28 matching lines...) Expand all Loading... |
1307 "BrowserOptions.setHighContrastCheckboxState", | 1307 "BrowserOptions.setHighContrastCheckboxState", |
1308 high_contrast_enabled); | 1308 high_contrast_enabled); |
1309 base::FundamentalValue virtual_keyboard_enabled( | 1309 base::FundamentalValue virtual_keyboard_enabled( |
1310 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); | 1310 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); |
1311 web_ui()->CallJavascriptFunction( | 1311 web_ui()->CallJavascriptFunction( |
1312 "BrowserOptions.setVirtualKeyboardCheckboxState", | 1312 "BrowserOptions.setVirtualKeyboardCheckboxState", |
1313 virtual_keyboard_enabled); | 1313 virtual_keyboard_enabled); |
1314 | 1314 |
1315 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1315 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1316 base::StringValue magnifier_type( | 1316 base::StringValue magnifier_type( |
1317 user_pref_service->GetString(prefs::kScreenMagnifierType)); | 1317 user_pref_service->GetString(prefs::kMagnifierType)); |
1318 web_ui()->CallJavascriptFunction( | 1318 web_ui()->CallJavascriptFunction( |
1319 "BrowserOptions.setScreenMagnifierTypeState", | 1319 "BrowserOptions.setMagnifierTypeState", |
1320 magnifier_type); | 1320 magnifier_type); |
1321 } | 1321 } |
1322 #endif | 1322 #endif |
1323 | 1323 |
1324 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { | 1324 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { |
1325 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) | 1325 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) |
1326 // Don't show the reporting setting if we are in the guest mode. | 1326 // Don't show the reporting setting if we are in the guest mode. |
1327 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { | 1327 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { |
1328 base::FundamentalValue visible(false); | 1328 base::FundamentalValue visible(false); |
1329 web_ui()->CallJavascriptFunction( | 1329 web_ui()->CallJavascriptFunction( |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 1415 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
1416 } | 1416 } |
1417 StringValue label(label_str); | 1417 StringValue label(label_str); |
1418 | 1418 |
1419 web_ui()->CallJavascriptFunction( | 1419 web_ui()->CallJavascriptFunction( |
1420 "BrowserOptions.setupProxySettingsSection", disabled, label); | 1420 "BrowserOptions.setupProxySettingsSection", disabled, label); |
1421 #endif // !defined(OS_CHROMEOS) | 1421 #endif // !defined(OS_CHROMEOS) |
1422 } | 1422 } |
1423 | 1423 |
1424 } // namespace options | 1424 } // namespace options |
OLD | NEW |