| Index: components/arc/arc_prefs.cc
|
| diff --git a/components/arc/arc_prefs.cc b/components/arc/arc_prefs.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4583274c7e5c034661b79ece38a67b1539033916
|
| --- /dev/null
|
| +++ b/components/arc/arc_prefs.cc
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "components/arc/arc_prefs.h"
|
| +
|
| +#include "base/command_line.h"
|
| +#include "base/prefs/pref_registry_simple.h"
|
| +#include "base/prefs/pref_service.h"
|
| +#include "chromeos/chromeos_switches.h"
|
| +#include "components/arc/arc_pref_names.h"
|
| +
|
| +namespace arc {
|
| +
|
| +// static
|
| +void ArcPrefs::RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
| + DCHECK(registry);
|
| + registry->RegisterBooleanPref(arc::prefs::kArcEnabled, false);
|
| +}
|
| +
|
| +// static
|
| +bool ArcPrefs::GetEnabled(const PrefService* prefs,
|
| + const base::CommandLine* command_line) {
|
| + return command_line->HasSwitch(chromeos::switches::kEnableArc) ||
|
| + (prefs && prefs->GetBoolean(arc::prefs::kArcEnabled));
|
| +}
|
| +
|
| +// static
|
| +void ArcPrefs::SetEnabled(PrefService* prefs, bool enabled) {
|
| + DCHECK(prefs);
|
| + prefs->SetBoolean(arc::prefs::kArcEnabled, enabled);
|
| +}
|
| +
|
| +} // namespace arc
|
|
|