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

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

Issue 11065008: Full Screen Magnifier: Add MagnificationManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase @169437 Created 8 years 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
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698