| 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 args->GetBoolean(0, &enabled); | 1258 args->GetBoolean(0, &enabled); |
| 1259 | 1259 |
| 1260 chromeos::accessibility::EnableHighContrast(enabled); | 1260 chromeos::accessibility::EnableHighContrast(enabled); |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 void BrowserOptionsHandler::ScreenMagnifierChangeCallback( | 1263 void BrowserOptionsHandler::ScreenMagnifierChangeCallback( |
| 1264 const ListValue* args) { | 1264 const ListValue* args) { |
| 1265 std::string type_name; | 1265 std::string type_name; |
| 1266 args->GetString(0, &type_name); | 1266 args->GetString(0, &type_name); |
| 1267 | 1267 |
| 1268 chromeos::accessibility::ScreenMagnifierType type = | 1268 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1269 chromeos::accessibility::ScreenMagnifierTypeFromName(type_name.c_str()); | 1269 user_pref_service->SetString(prefs::kScreenMagnifierType, |
| 1270 | 1270 type_name); |
| 1271 chromeos::accessibility::SetScreenMagnifier(type); | |
| 1272 } | 1271 } |
| 1273 | 1272 |
| 1274 void BrowserOptionsHandler::VirtualKeyboardChangeCallback( | 1273 void BrowserOptionsHandler::VirtualKeyboardChangeCallback( |
| 1275 const ListValue* args) { | 1274 const ListValue* args) { |
| 1276 bool enabled = false; | 1275 bool enabled = false; |
| 1277 args->GetBoolean(0, &enabled); | 1276 args->GetBoolean(0, &enabled); |
| 1278 | 1277 |
| 1279 chromeos::accessibility::EnableVirtualKeyboard(enabled); | 1278 chromeos::accessibility::EnableVirtualKeyboard(enabled); |
| 1280 } | 1279 } |
| 1281 | 1280 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1301 base::FundamentalValue spoken_feedback_enabled( | 1300 base::FundamentalValue spoken_feedback_enabled( |
| 1302 pref_service->GetBoolean(prefs::kSpokenFeedbackEnabled)); | 1301 pref_service->GetBoolean(prefs::kSpokenFeedbackEnabled)); |
| 1303 web_ui()->CallJavascriptFunction( | 1302 web_ui()->CallJavascriptFunction( |
| 1304 "BrowserOptions.setSpokenFeedbackCheckboxState", | 1303 "BrowserOptions.setSpokenFeedbackCheckboxState", |
| 1305 spoken_feedback_enabled); | 1304 spoken_feedback_enabled); |
| 1306 base::FundamentalValue high_contrast_enabled( | 1305 base::FundamentalValue high_contrast_enabled( |
| 1307 pref_service->GetBoolean(prefs::kHighContrastEnabled)); | 1306 pref_service->GetBoolean(prefs::kHighContrastEnabled)); |
| 1308 web_ui()->CallJavascriptFunction( | 1307 web_ui()->CallJavascriptFunction( |
| 1309 "BrowserOptions.setHighContrastCheckboxState", | 1308 "BrowserOptions.setHighContrastCheckboxState", |
| 1310 high_contrast_enabled); | 1309 high_contrast_enabled); |
| 1311 | |
| 1312 base::StringValue magnifier_type( | |
| 1313 pref_service->GetString(prefs::kScreenMagnifierType)); | |
| 1314 web_ui()->CallJavascriptFunction( | |
| 1315 "BrowserOptions.setScreenMagnifierTypeState", | |
| 1316 magnifier_type); | |
| 1317 | |
| 1318 base::FundamentalValue virtual_keyboard_enabled( | 1310 base::FundamentalValue virtual_keyboard_enabled( |
| 1319 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); | 1311 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); |
| 1320 web_ui()->CallJavascriptFunction( | 1312 web_ui()->CallJavascriptFunction( |
| 1321 "BrowserOptions.setVirtualKeyboardCheckboxState", | 1313 "BrowserOptions.setVirtualKeyboardCheckboxState", |
| 1322 virtual_keyboard_enabled); | 1314 virtual_keyboard_enabled); |
| 1315 |
| 1316 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1317 base::StringValue magnifier_type( |
| 1318 user_pref_service->GetString(prefs::kScreenMagnifierType)); |
| 1319 web_ui()->CallJavascriptFunction( |
| 1320 "BrowserOptions.setScreenMagnifierTypeState", |
| 1321 magnifier_type); |
| 1323 } | 1322 } |
| 1324 #endif | 1323 #endif |
| 1325 | 1324 |
| 1326 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { | 1325 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { |
| 1327 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) | 1326 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) |
| 1328 // Don't show the reporting setting if we are in the guest mode. | 1327 // Don't show the reporting setting if we are in the guest mode. |
| 1329 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { | 1328 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { |
| 1330 base::FundamentalValue visible(false); | 1329 base::FundamentalValue visible(false); |
| 1331 web_ui()->CallJavascriptFunction( | 1330 web_ui()->CallJavascriptFunction( |
| 1332 "BrowserOptions.setMetricsReportingSettingVisibility", visible); | 1331 "BrowserOptions.setMetricsReportingSettingVisibility", visible); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 1416 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 1418 } | 1417 } |
| 1419 StringValue label(label_str); | 1418 StringValue label(label_str); |
| 1420 | 1419 |
| 1421 web_ui()->CallJavascriptFunction( | 1420 web_ui()->CallJavascriptFunction( |
| 1422 "BrowserOptions.setupProxySettingsSection", disabled, label); | 1421 "BrowserOptions.setupProxySettingsSection", disabled, label); |
| 1423 #endif // !defined(OS_CHROMEOS) | 1422 #endif // !defined(OS_CHROMEOS) |
| 1424 } | 1423 } |
| 1425 | 1424 |
| 1426 } // namespace options | 1425 } // namespace options |
| OLD | NEW |