| 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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 base::FundamentalValue spoken_feedback_enabled( | 1287 base::FundamentalValue spoken_feedback_enabled( |
| 1288 pref_service->GetBoolean(prefs::kSpokenFeedbackEnabled)); | 1288 pref_service->GetBoolean(prefs::kSpokenFeedbackEnabled)); |
| 1289 web_ui()->CallJavascriptFunction( | 1289 web_ui()->CallJavascriptFunction( |
| 1290 "BrowserOptions.setSpokenFeedbackCheckboxState", | 1290 "BrowserOptions.setSpokenFeedbackCheckboxState", |
| 1291 spoken_feedback_enabled); | 1291 spoken_feedback_enabled); |
| 1292 base::FundamentalValue high_contrast_enabled( | 1292 base::FundamentalValue high_contrast_enabled( |
| 1293 pref_service->GetBoolean(prefs::kHighContrastEnabled)); | 1293 pref_service->GetBoolean(prefs::kHighContrastEnabled)); |
| 1294 web_ui()->CallJavascriptFunction( | 1294 web_ui()->CallJavascriptFunction( |
| 1295 "BrowserOptions.setHighContrastCheckboxState", | 1295 "BrowserOptions.setHighContrastCheckboxState", |
| 1296 high_contrast_enabled); | 1296 high_contrast_enabled); |
| 1297 base::FundamentalValue screen_magnifier_enabled( |
| 1298 pref_service->GetBoolean(prefs::kScreenMagnifierEnabled)); |
| 1299 web_ui()->CallJavascriptFunction( |
| 1300 "BrowserOptions.setScreenMagnifierCheckboxState", |
| 1301 screen_magnifier_enabled); |
| 1297 base::FundamentalValue virtual_keyboard_enabled( | 1302 base::FundamentalValue virtual_keyboard_enabled( |
| 1298 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); | 1303 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); |
| 1299 web_ui()->CallJavascriptFunction( | 1304 web_ui()->CallJavascriptFunction( |
| 1300 "BrowserOptions.setVirtualKeyboardCheckboxState", | 1305 "BrowserOptions.setVirtualKeyboardCheckboxState", |
| 1301 virtual_keyboard_enabled); | 1306 virtual_keyboard_enabled); |
| 1302 | |
| 1303 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | |
| 1304 base::FundamentalValue screen_magnifier_enabled( | |
| 1305 user_pref_service->GetBoolean(prefs::kScreenMagnifierEnabled)); | |
| 1306 web_ui()->CallJavascriptFunction( | |
| 1307 "BrowserOptions.setScreenMagnifierCheckboxState", | |
| 1308 screen_magnifier_enabled); | |
| 1309 } | 1307 } |
| 1310 #endif | 1308 #endif |
| 1311 | 1309 |
| 1312 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { | 1310 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { |
| 1313 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) | 1311 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) |
| 1314 // Don't show the reporting setting if we are in the guest mode. | 1312 // Don't show the reporting setting if we are in the guest mode. |
| 1315 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { | 1313 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { |
| 1316 base::FundamentalValue visible(false); | 1314 base::FundamentalValue visible(false); |
| 1317 web_ui()->CallJavascriptFunction( | 1315 web_ui()->CallJavascriptFunction( |
| 1318 "BrowserOptions.setMetricsReportingSettingVisibility", visible); | 1316 "BrowserOptions.setMetricsReportingSettingVisibility", visible); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 1401 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 1404 } | 1402 } |
| 1405 StringValue label(label_str); | 1403 StringValue label(label_str); |
| 1406 | 1404 |
| 1407 web_ui()->CallJavascriptFunction( | 1405 web_ui()->CallJavascriptFunction( |
| 1408 "BrowserOptions.setupProxySettingsSection", disabled, label); | 1406 "BrowserOptions.setupProxySettingsSection", disabled, label); |
| 1409 #endif // !defined(OS_CHROMEOS) | 1407 #endif // !defined(OS_CHROMEOS) |
| 1410 } | 1408 } |
| 1411 | 1409 |
| 1412 } // namespace options | 1410 } // namespace options |
| OLD | NEW |