Home | History | Annotate | Download | only in chromeos
      1 // Copyright (c) 2010 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 "chrome/browser/chromeos/cros_settings_provider.h"
      6 
      7 #include "base/command_line.h"
      8 #include "base/logging.h"
      9 #include "base/string_util.h"
     10 #include "chrome/common/chrome_switches.h"
     11 
     12 namespace chromeos {
     13 
     14 void CrosSettingsProvider::Set(const std::string& path, Value* value) {
     15   // We don't allow changing any of the cros settings without prefix
     16   // "cros.session." in the guest mode.
     17   // It should not reach here from UI in the guest mode, but just in case.
     18   if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession) &&
     19       !::StartsWithASCII(path, "cros.session.", true)) {
     20     LOG(ERROR) << "Ignoring the guest request to change: " << path;
     21     return;
     22   }
     23   DoSet(path, value);
     24 }
     25 
     26 };  // namespace chromeos
     27