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

Side by Side Diff: components/arc/arc_prefs.cc

Issue 1412863004: arc-bridge: Add the ARC Bridge Service (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Addressed feedback from Issue 1416313004 Created 5 years, 1 month 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
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698