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

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

Issue 11550010: Remove partial magnifier from settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a boolean pref instead of string pref. 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/resources/options/browser_options.js ('k') | chrome/common/pref_names.h » ('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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 base::Unretained(this))); 539 base::Unretained(this)));
540 web_ui()->RegisterMessageCallback( 540 web_ui()->RegisterMessageCallback(
541 "spokenFeedbackChange", 541 "spokenFeedbackChange",
542 base::Bind(&BrowserOptionsHandler::SpokenFeedbackChangeCallback, 542 base::Bind(&BrowserOptionsHandler::SpokenFeedbackChangeCallback,
543 base::Unretained(this))); 543 base::Unretained(this)));
544 web_ui()->RegisterMessageCallback( 544 web_ui()->RegisterMessageCallback(
545 "highContrastChange", 545 "highContrastChange",
546 base::Bind(&BrowserOptionsHandler::HighContrastChangeCallback, 546 base::Bind(&BrowserOptionsHandler::HighContrastChangeCallback,
547 base::Unretained(this))); 547 base::Unretained(this)));
548 web_ui()->RegisterMessageCallback( 548 web_ui()->RegisterMessageCallback(
549 "screenMagnifierChange",
550 base::Bind(&BrowserOptionsHandler::ScreenMagnifierChangeCallback,
551 base::Unretained(this)));
552 web_ui()->RegisterMessageCallback(
553 "virtualKeyboardChange", 549 "virtualKeyboardChange",
554 base::Bind(&BrowserOptionsHandler::VirtualKeyboardChangeCallback, 550 base::Bind(&BrowserOptionsHandler::VirtualKeyboardChangeCallback,
555 base::Unretained(this))); 551 base::Unretained(this)));
556 web_ui()->RegisterMessageCallback( 552 web_ui()->RegisterMessageCallback(
557 "performFactoryResetRestart", 553 "performFactoryResetRestart",
558 base::Bind(&BrowserOptionsHandler::PerformFactoryResetRestart, 554 base::Bind(&BrowserOptionsHandler::PerformFactoryResetRestart,
559 base::Unretained(this))); 555 base::Unretained(this)));
560 #endif 556 #endif
561 } 557 }
562 558
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 enabled, NULL, ash::A11Y_NOTIFICATION_NONE); 1264 enabled, NULL, ash::A11Y_NOTIFICATION_NONE);
1269 } 1265 }
1270 1266
1271 void BrowserOptionsHandler::HighContrastChangeCallback(const ListValue* args) { 1267 void BrowserOptionsHandler::HighContrastChangeCallback(const ListValue* args) {
1272 bool enabled = false; 1268 bool enabled = false;
1273 args->GetBoolean(0, &enabled); 1269 args->GetBoolean(0, &enabled);
1274 1270
1275 chromeos::accessibility::EnableHighContrast(enabled); 1271 chromeos::accessibility::EnableHighContrast(enabled);
1276 } 1272 }
1277 1273
1278 void BrowserOptionsHandler::ScreenMagnifierChangeCallback(
1279 const ListValue* args) {
1280 std::string type_name;
1281 args->GetString(0, &type_name);
1282
1283 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
1284 user_pref_service->SetString(prefs::kMagnifierType,
1285 type_name);
1286 }
1287
1288 void BrowserOptionsHandler::VirtualKeyboardChangeCallback( 1274 void BrowserOptionsHandler::VirtualKeyboardChangeCallback(
1289 const ListValue* args) { 1275 const ListValue* args) {
1290 bool enabled = false; 1276 bool enabled = false;
1291 args->GetBoolean(0, &enabled); 1277 args->GetBoolean(0, &enabled);
1292 1278
1293 chromeos::accessibility::EnableVirtualKeyboard(enabled); 1279 chromeos::accessibility::EnableVirtualKeyboard(enabled);
1294 } 1280 }
1295 1281
1296 #if defined(OS_CHROMEOS) 1282 #if defined(OS_CHROMEOS)
1297 1283
(...skipping 22 matching lines...) Expand all
1320 base::FundamentalValue high_contrast_enabled( 1306 base::FundamentalValue high_contrast_enabled(
1321 pref_service->GetBoolean(prefs::kHighContrastEnabled)); 1307 pref_service->GetBoolean(prefs::kHighContrastEnabled));
1322 web_ui()->CallJavascriptFunction( 1308 web_ui()->CallJavascriptFunction(
1323 "BrowserOptions.setHighContrastCheckboxState", 1309 "BrowserOptions.setHighContrastCheckboxState",
1324 high_contrast_enabled); 1310 high_contrast_enabled);
1325 base::FundamentalValue virtual_keyboard_enabled( 1311 base::FundamentalValue virtual_keyboard_enabled(
1326 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); 1312 pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled));
1327 web_ui()->CallJavascriptFunction( 1313 web_ui()->CallJavascriptFunction(
1328 "BrowserOptions.setVirtualKeyboardCheckboxState", 1314 "BrowserOptions.setVirtualKeyboardCheckboxState",
1329 virtual_keyboard_enabled); 1315 virtual_keyboard_enabled);
1330
1331 PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
1332 base::StringValue magnifier_type(
1333 user_pref_service->GetString(prefs::kMagnifierType));
1334 web_ui()->CallJavascriptFunction(
1335 "BrowserOptions.setMagnifierTypeState",
1336 magnifier_type);
1337 } 1316 }
1338 #endif 1317 #endif
1339 1318
1340 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { 1319 void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() {
1341 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) 1320 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS)
1342 // Don't show the reporting setting if we are in the guest mode. 1321 // Don't show the reporting setting if we are in the guest mode.
1343 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { 1322 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) {
1344 base::FundamentalValue visible(false); 1323 base::FundamentalValue visible(false);
1345 web_ui()->CallJavascriptFunction( 1324 web_ui()->CallJavascriptFunction(
1346 "BrowserOptions.setMetricsReportingSettingVisibility", visible); 1325 "BrowserOptions.setMetricsReportingSettingVisibility", visible);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 1410 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
1432 } 1411 }
1433 StringValue label(label_str); 1412 StringValue label(label_str);
1434 1413
1435 web_ui()->CallJavascriptFunction( 1414 web_ui()->CallJavascriptFunction(
1436 "BrowserOptions.setupProxySettingsSection", disabled, label); 1415 "BrowserOptions.setupProxySettingsSection", disabled, label);
1437 #endif // !defined(OS_CHROMEOS) 1416 #endif // !defined(OS_CHROMEOS)
1438 } 1417 }
1439 1418
1440 } // namespace options 1419 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698