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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate_chromeos.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, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
index 09becbbe96ac98fbd54706f64fe5ee2d0824b680..7c8209e8c7ed3fab0593a3331829a13a7f70f40a 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
@@ -234,6 +234,35 @@ void ChromeShellDelegate::HandleMediaPrevTrack() {
media_player_event_router()->NotifyPrevTrack();
}
+bool ChromeShellDelegate::IsTouchHudProjectionEnabled() const {
+ if (!ProfileManager::IsGetDefaultProfileAllowed())
+ return false;
+
+ Profile* profile = ProfileManager::GetDefaultProfile();
+ if (!profile)
+ return false;
+
+ PrefService* pref_service = profile->GetPrefs();
+ return pref_service &&
+ pref_service->GetBoolean(prefs::kTouchHudProjectionEnabled);
+}
+
+void ChromeShellDelegate::ToggleTouchHudProjection() {
+ if (!ProfileManager::IsGetDefaultProfileAllowed())
+ return;
+
+ Profile* profile = ProfileManager::GetDefaultProfile();
+ if (!profile)
+ return;
+
+ PrefService* pref_service = profile->GetPrefs();
+ if (!pref_service)
+ return;
+
+ bool enabled = pref_service->GetBoolean(prefs::kTouchHudProjectionEnabled);
+ pref_service->SetBoolean(prefs::kTouchHudProjectionEnabled, !enabled);
+}
+
void ChromeShellDelegate::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {

Powered by Google App Engine
This is Rietveld 408576698