diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-02 20:41:27 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-02 20:41:27 +0000 |
commit | 119af158007dbb474f8b4d990eac9123aee90128 (patch) | |
tree | 2c42f2b49d7888cfd7d0f9584b40c30caef5f222 /chromeos/app_mode | |
parent | 556f304856a31caed67a28a9d29fb530c6749f32 (diff) | |
download | chromium_src-119af158007dbb474f8b4d990eac9123aee90128.zip chromium_src-119af158007dbb474f8b4d990eac9123aee90128.tar.gz chromium_src-119af158007dbb474f8b4d990eac9123aee90128.tar.bz2 |
Revert 197960 "[chromeos] Remove dependencies of StatisticsProvi..."
> [chromeos] Remove dependencies of StatisticsProvider on chrome.
>
> BUG=180711
> R=davemoore@google.com
>
> Review URL: https://codereview.chromium.org/14643006
TBR=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/14642018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/app_mode')
-rw-r--r-- | chromeos/app_mode/kiosk_oem_manifest_parser.cc | 58 | ||||
-rw-r--r-- | chromeos/app_mode/kiosk_oem_manifest_parser.h | 44 | ||||
-rw-r--r-- | chromeos/app_mode/kiosk_oem_manifest_parser_unittest.cc | 29 |
3 files changed, 0 insertions, 131 deletions
diff --git a/chromeos/app_mode/kiosk_oem_manifest_parser.cc b/chromeos/app_mode/kiosk_oem_manifest_parser.cc deleted file mode 100644 index c51296f..0000000 --- a/chromeos/app_mode/kiosk_oem_manifest_parser.cc +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2012 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 "chromeos/app_mode/kiosk_oem_manifest_parser.h" - -#include "base/json/json_file_value_serializer.h" -#include "base/stringprintf.h" -#include "base/values.h" - -namespace chromeos { - -namespace { - -const char kEnterpriseManaged[] = "enterprise_managed"; -const char kAllowReset[] = "can_exit_enrollment"; -const char kDeviceRequisition[] = "device_requisition"; -const char kKeyboardDrivenOobe[] = "keyboard_driven_oobe"; - -} // namespace - -KioskOemManifestParser::Manifest::Manifest() - : enterprise_managed(false), - can_exit_enrollment(true), - keyboard_driven_oobe(false) { -} - -bool KioskOemManifestParser::Load( - const base::FilePath& kiosk_oem_file, - KioskOemManifestParser::Manifest* manifest) { - int error_code = JSONFileValueSerializer::JSON_NO_ERROR; - std::string error_msg; - scoped_ptr<JSONFileValueSerializer> serializer( - new JSONFileValueSerializer(kiosk_oem_file)); - scoped_ptr<base::Value> value( - serializer->Deserialize(&error_code, &error_msg)); - base::DictionaryValue* dict = NULL; - if (error_code != JSONFileValueSerializer::JSON_NO_ERROR || - !value.get() || - !value->GetAsDictionary(&dict)) { - return false; - } - - dict->GetString(kDeviceRequisition, - &manifest->device_requisition); - dict->GetBoolean(kKeyboardDrivenOobe, - &manifest->keyboard_driven_oobe); - if (!dict->GetBoolean(kEnterpriseManaged, - &manifest->enterprise_managed) || - !dict->GetBoolean(kAllowReset, - &manifest->can_exit_enrollment)) { - return false; - } - - return true; -} - -} // namespace chromeos diff --git a/chromeos/app_mode/kiosk_oem_manifest_parser.h b/chromeos/app_mode/kiosk_oem_manifest_parser.h deleted file mode 100644 index 05b7e0a..0000000 --- a/chromeos/app_mode/kiosk_oem_manifest_parser.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2013 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. - -#ifndef CHROMEOS_APP_MODE_KIOSK_OEM_MANIFEST_PARSER_H_ -#define CHROMEOS_APP_MODE_KIOSK_OEM_MANIFEST_PARSER_H_ - -#include <string> - -#include "base/files/file_path.h" -#include "chromeos/chromeos_export.h" - -namespace chromeos { - -// Parser for app kiosk OEM manifest files. -class CHROMEOS_EXPORT KioskOemManifestParser { - public: - // Kiosk OEM manifest. - struct Manifest { - Manifest(); - - // True if OOBE flow should enforce enterprise enrollment. - bool enterprise_managed; - // True user can exit enterprise enrollment during OOBE. - bool can_exit_enrollment; - // Intended purpose of the device. Meant to be pass-through value for - // enterprise enrollment. - std::string device_requisition; - // True if OOBE flow should be adapted for keyboard flow. - bool keyboard_driven_oobe; - }; - - // Loads manifest from |kiosk_oem_file|. Returns true if manifest was - // found and successfully parsed. - static bool Load(const base::FilePath& kiosk_oem_file, - Manifest* manifest); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(KioskOemManifestParser); -}; - -} // namespace chromeos - -#endif // CHROMEOS_APP_MODE_KIOSK_OEM_MANIFEST_PARSER_H_ diff --git a/chromeos/app_mode/kiosk_oem_manifest_parser_unittest.cc b/chromeos/app_mode/kiosk_oem_manifest_parser_unittest.cc deleted file mode 100644 index 246a797..0000000 --- a/chromeos/app_mode/kiosk_oem_manifest_parser_unittest.cc +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2012 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 "chromeos/app_mode/kiosk_oem_manifest_parser.h" - -#include "base/path_service.h" -#include "chromeos/chromeos_test_utils.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace chromeos { - -typedef testing::Test KioskOemManifestParserTest; - -TEST_F(KioskOemManifestParserTest, LoadTest) { - base::FilePath test_data_dir; - ASSERT_TRUE(chromeos::test_utils::GetTestDataPath( - "app_mode", "kiosk_manifest", &test_data_dir)); - base::FilePath kiosk_oem_file = - test_data_dir.AppendASCII("kiosk_manifest.json"); - KioskOemManifestParser::Manifest manifest; - EXPECT_TRUE(KioskOemManifestParser::Load(kiosk_oem_file, &manifest)); - EXPECT_TRUE(manifest.enterprise_managed); - EXPECT_FALSE(manifest.can_exit_enrollment); - EXPECT_TRUE(manifest.keyboard_driven_oobe); - EXPECT_EQ(manifest.device_requisition, std::string("test")); -} - -} // namespace chromeos |