Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/arc/arc_prefs.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "base/prefs/pref_registry_simple.h" | |
| 9 #include "base/prefs/pref_service.h" | |
| 10 #include "chromeos/chromeos_switches.h" | |
| 11 #include "components/arc/arc_pref_names.h" | |
| 12 | |
| 13 namespace arc { | |
| 14 | |
| 15 // static | |
| 16 void ArcPrefs::RegisterProfilePrefs(PrefRegistrySimple* registry) { | |
| 17 DCHECK(registry); | |
| 18 registry->RegisterBooleanPref(arc::prefs::kArcEnabled, false); | |
| 19 } | |
| 20 | |
| 21 // static | |
| 22 bool ArcPrefs::GetEnabled(const PrefService* prefs, | |
| 23 const base::CommandLine* command_line) { | |
| 24 return command_line->HasSwitch(chromeos::switches::kEnableArc) || | |
| 25 (prefs && prefs->GetBoolean(arc::prefs::kArcEnabled)); | |
|
jochen (gone - plz use gerrit)
2015/11/12 23:40:59
when is prefs null?
Luis Héctor Chávez
2015/11/13 00:29:29
Not anymore. Removed check.
| |
| 26 } | |
| 27 | |
| 28 // static | |
| 29 void ArcPrefs::SetEnabled(PrefService* prefs, bool enabled) { | |
| 30 DCHECK(prefs); | |
| 31 prefs->SetBoolean(arc::prefs::kArcEnabled, enabled); | |
| 32 } | |
| 33 | |
| 34 } // namespace arc | |
| OLD | NEW |