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

Side by Side Diff: chrome/browser/chromeos/preferences.cc

Issue 18163006: Add persisted preference for projection touch HUD (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months 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.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.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/chromeos/preferences.h" 5 #include "chrome/browser/chromeos/preferences.h"
6 6
7 #include "ash/magnifier/magnifier_constants.h" 7 #include "ash/magnifier/magnifier_constants.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "base/chromeos/chromeos_version.h" 9 #include "base/chromeos/chromeos_version.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 399 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
400 registry->RegisterDoublePref( 400 registry->RegisterDoublePref(
401 prefs::kPowerUserActivityScreenDimDelayFactor, 401 prefs::kPowerUserActivityScreenDimDelayFactor,
402 2.0, 402 2.0,
403 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 403 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
404 404
405 registry->RegisterStringPref( 405 registry->RegisterStringPref(
406 prefs::kTermsOfServiceURL, 406 prefs::kTermsOfServiceURL,
407 "", 407 "",
408 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 408 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
409
410 registry->RegisterBooleanPref(
411 prefs::kTouchHudProjectionEnabled,
412 false,
413 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
409 } 414 }
410 415
411 void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) { 416 void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) {
412 prefs_ = prefs; 417 prefs_ = prefs;
413 418
414 BooleanPrefMember::NamedChangeCallback callback = 419 BooleanPrefMember::NamedChangeCallback callback =
415 base::Bind(&Preferences::OnPreferenceChanged, base::Unretained(this)); 420 base::Bind(&Preferences::OnPreferenceChanged, base::Unretained(this));
416 421
417 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, prefs, callback); 422 tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, prefs, callback);
418 tap_dragging_enabled_.Init(prefs::kTapDraggingEnabled, prefs, callback); 423 tap_dragging_enabled_.Init(prefs::kTapDraggingEnabled, prefs, callback);
(...skipping 19 matching lines...) Expand all
438 disable_drive_over_cellular_.Init(prefs::kDisableDriveOverCellular, 443 disable_drive_over_cellular_.Init(prefs::kDisableDriveOverCellular,
439 prefs, callback); 444 prefs, callback);
440 disable_drive_hosted_files_.Init(prefs::kDisableDriveHostedFiles, 445 disable_drive_hosted_files_.Init(prefs::kDisableDriveHostedFiles,
441 prefs, callback); 446 prefs, callback);
442 download_default_directory_.Init(prefs::kDownloadDefaultDirectory, 447 download_default_directory_.Init(prefs::kDownloadDefaultDirectory,
443 prefs, callback); 448 prefs, callback);
444 select_file_last_directory_.Init(prefs::kSelectFileLastDirectory, 449 select_file_last_directory_.Init(prefs::kSelectFileLastDirectory,
445 prefs, callback); 450 prefs, callback);
446 save_file_default_directory_.Init(prefs::kSaveFileDefaultDirectory, 451 save_file_default_directory_.Init(prefs::kSaveFileDefaultDirectory,
447 prefs, callback); 452 prefs, callback);
453 touch_hud_projection_enabled_.Init(prefs::kTouchHudProjectionEnabled,
454 prefs, callback);
448 primary_mouse_button_right_.Init(prefs::kPrimaryMouseButtonRight, 455 primary_mouse_button_right_.Init(prefs::kPrimaryMouseButtonRight,
449 prefs, callback); 456 prefs, callback);
450 preferred_languages_.Init(prefs::kLanguagePreferredLanguages, 457 preferred_languages_.Init(prefs::kLanguagePreferredLanguages,
451 prefs, callback); 458 prefs, callback);
452 preload_engines_.Init(prefs::kLanguagePreloadEngines, prefs, callback); 459 preload_engines_.Init(prefs::kLanguagePreloadEngines, prefs, callback);
453 enabled_extension_imes_.Init(prefs::kLanguageEnabledExtensionImes, 460 enabled_extension_imes_.Init(prefs::kLanguageEnabledExtensionImes,
454 prefs, callback); 461 prefs, callback);
455 current_input_method_.Init(prefs::kLanguageCurrentInputMethod, 462 current_input_method_.Init(prefs::kLanguageCurrentInputMethod,
456 prefs, callback); 463 prefs, callback);
457 previous_input_method_.Init(prefs::kLanguagePreviousInputMethod, 464 previous_input_method_.Init(prefs::kLanguagePreviousInputMethod,
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 if (!pref_name || *pref_name == prefs::kSaveFileDefaultDirectory) { 699 if (!pref_name || *pref_name == prefs::kSaveFileDefaultDirectory) {
693 const base::FilePath pref_path = save_file_default_directory_.GetValue(); 700 const base::FilePath pref_path = save_file_default_directory_.GetValue();
694 // This pref can contain a Drive path, which needs to be updated due to 701 // This pref can contain a Drive path, which needs to be updated due to
695 // namespaces introduced by crbug.com/174233. 702 // namespaces introduced by crbug.com/174233.
696 // TODO(haruki): Remove this when migration completes. crbug.com/229304. 703 // TODO(haruki): Remove this when migration completes. crbug.com/229304.
697 if (drive::util::NeedsNamespaceMigration(pref_path)) { 704 if (drive::util::NeedsNamespaceMigration(pref_path)) {
698 prefs_->SetFilePath(prefs::kSaveFileDefaultDirectory, 705 prefs_->SetFilePath(prefs::kSaveFileDefaultDirectory,
699 drive::util::ConvertToMyDriveNamespace(pref_path)); 706 drive::util::ConvertToMyDriveNamespace(pref_path));
700 } 707 }
701 } 708 }
709 if (!pref_name || *pref_name == prefs::kTouchHudProjectionEnabled) {
710 const bool enabled = touch_hud_projection_enabled_.GetValue();
711 ash::Shell::GetInstance()->TouchHudProjectionEnabledChanged(enabled);
sky 2013/07/03 13:47:08 Wouldn't all this be simpler if Shell had a SetTou
mohsen 2013/07/03 15:30:40 Do you mean a SetTouchHudProjectionEnabled(boolean
712 }
702 713
703 if (!pref_name || *pref_name == prefs::kLanguagePreferredLanguages) { 714 if (!pref_name || *pref_name == prefs::kLanguagePreferredLanguages) {
704 // Unlike kLanguagePreloadEngines and some other input method 715 // Unlike kLanguagePreloadEngines and some other input method
705 // preferencs, we don't need to send this to ibus-daemon. 716 // preferencs, we don't need to send this to ibus-daemon.
706 } 717 }
707 718
708 if (!pref_name || *pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { 719 if (!pref_name || *pref_name == prefs::kLanguageXkbAutoRepeatEnabled) {
709 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); 720 const bool enabled = xkb_auto_repeat_enabled_.GetValue();
710 input_method::XKeyboard::SetAutoRepeatEnabled(enabled); 721 input_method::XKeyboard::SetAutoRepeatEnabled(enabled);
711 } 722 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 1024
1014 input_method::AutoRepeatRate rate; 1025 input_method::AutoRepeatRate rate;
1015 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); 1026 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue();
1016 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); 1027 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue();
1017 DCHECK(rate.initial_delay_in_ms > 0); 1028 DCHECK(rate.initial_delay_in_ms > 0);
1018 DCHECK(rate.repeat_interval_in_ms > 0); 1029 DCHECK(rate.repeat_interval_in_ms > 0);
1019 input_method::XKeyboard::SetAutoRepeatRate(rate); 1030 input_method::XKeyboard::SetAutoRepeatRate(rate);
1020 } 1031 }
1021 1032
1022 } // namespace chromeos 1033 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698