summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/customization_document.cc
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 20:03:32 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 20:03:32 +0000
commit9d5804f68add5c1ab7bb48be7989d798f0988375 (patch)
tree3b31ae298d7d2154337ac6622f8b361abef38f0b /chrome/browser/chromeos/customization_document.cc
parent044627eb27f28939855307d4f33cf46af33bd185 (diff)
downloadchromium_src-9d5804f68add5c1ab7bb48be7989d798f0988375.zip
chromium_src-9d5804f68add5c1ab7bb48be7989d798f0988375.tar.gz
chromium_src-9d5804f68add5c1ab7bb48be7989d798f0988375.tar.bz2
Revert 48424 - Adding initial implementation of the PartnerCustomization classes.
BUG=chromiumos:3176 TEST=Run out/Debug/unit_tests. Run out/Debug/chrome loginmanager startupmanifest=./chrome/browser/chromeos/testdata/startup_manifest.json. There should be no asserts. Review URL: http://codereview.chromium.org/2101021 TBR=denisromanov@chromium.org Build error below. I don't immediately see how this CL caused the problem, but the only other things on the blamelist are valgrind suppressions which don't change code. Linking... LINK : warning LNK4224: /OPT:NOWIN98 is no longer supported; ignored Creating library C:\b\slave\chromium-rel-builder\build\src\build\Release\lib\npchrome_frame.lib and object C:\b\slave\chromium-rel-builder\build\src\build\Release\lib\npchrome_frame.exp chrome_tab.obj : error LNK2001: unresolved external symbol "unsigned int (__stdcall* ATL::g_pfnGetThreadACP)(void)" (?g_pfnGetThreadACP@ATL@@3P6GIXZA) chrome_frame_ie.lib(chrome_active_document.obj) : error LNK2001: unresolved external symbol "unsigned int (__stdcall* ATL::g_pfnGetThreadACP)(void)" (?g_pfnGetThreadACP@ATL@@3P6GIXZA) chrome_frame_npapi.lib(utils.obj) : error LNK2001: unresolved external symbol "unsigned int (__stdcall* ATL::g_pfnGetThreadACP)(void)" (?g_pfnGetThreadACP@ATL@@3P6GIXZA) C:\b\slave\chromium-rel-builder\build\src\build\Release\servers\npchrome_frame.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe (tool returned code: 1120) 2 build system warning(s): - VS settings folder not found - Interoperability reenabled Review URL: http://codereview.chromium.org/2224008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/customization_document.cc')
-rw-r--r--chrome/browser/chromeos/customization_document.cc135
1 files changed, 0 insertions, 135 deletions
diff --git a/chrome/browser/chromeos/customization_document.cc b/chrome/browser/chromeos/customization_document.cc
deleted file mode 100644
index 883313f..0000000
--- a/chrome/browser/chromeos/customization_document.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (c) 2010 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 "chrome/browser/chromeos/customization_document.h"
-
-#include <string>
-
-#include "base/file_path.h"
-#include "base/file_util.h"
-#include "base/json/json_reader.h"
-#include "base/logging.h"
-#include "base/string_util.h"
-#include "base/values.h"
-
-// Manifest attributes names.
-
-namespace {
-
-const wchar_t kVersionAttr[] = L"version";
-const wchar_t kProductSkuAttr[] = L"product_sku";
-const wchar_t kInitialLocaleAttr[] = L"initial_locale";
-const wchar_t kBackgroundColorAttr[] = L"background_color";
-const wchar_t kRegistrationUrlAttr[] = L"registration_url";
-const wchar_t kSetupContentAttr[] = L"setup_content";
-const wchar_t kContentLocaleAttr[] = L"content_locale";
-const wchar_t kHelpPageAttr[] = L"help_page";
-const wchar_t kEulaPageAttr[] = L"eula_page";
-const wchar_t kAppMenuAttr[] = L"app_menu";
-const wchar_t kInitialStartPageAttr[] = L"initial_start_page";
-const wchar_t kSectionTitleAttr[] = L"section_title";
-const wchar_t kWebAppsAttr[] = L"web_apps";
-const wchar_t kSupportPageAttr[] = L"support_page";
-const wchar_t kExtensionsAttr[] = L"extensions";
-
-const char kAcceptedManifestVersion[] = "1.0";
-
-} // anonymous namespace
-
-namespace chromeos {
-
-// CustomizationDocument implementation.
-
-bool CustomizationDocument::LoadManifestFromFile(
- const FilePath& manifest_path) {
- std::string manifest;
- bool read_success = file_util::ReadFileToString(manifest_path, &manifest);
- if (!read_success) {
- return false;
- }
- return LoadManifestFromString(manifest);
-}
-
-bool CustomizationDocument::LoadManifestFromString(
- const std::string& manifest) {
- scoped_ptr<Value> root(base::JSONReader::Read(manifest, true));
- DCHECK(root.get() != NULL);
- if (root.get() == NULL)
- return false;
- DCHECK(root->GetType() == Value::TYPE_DICTIONARY);
- return ParseFromJsonValue(static_cast<DictionaryValue*>(root.get()));
-}
-
-bool CustomizationDocument::ParseFromJsonValue(const DictionaryValue* root) {
- // Partner customization manifests share only one required field -
- // version string.
- bool result = root->GetString(kVersionAttr, &version_);
- return result && version_ == kAcceptedManifestVersion;
-}
-
-// StartupCustomizationDocument implementation.
-
-bool StartupCustomizationDocument::ParseFromJsonValue(
- const DictionaryValue* root) {
- if (!CustomizationDocument::ParseFromJsonValue(root))
- return false;
- // Rquired fields.
- if (!root->GetString(kProductSkuAttr, &product_sku_))
- return false;
- // Optional fields.
- root->GetString(kInitialLocaleAttr, &initial_locale_);
- std::string background_color_string;
- root->GetString(kBackgroundColorAttr, &background_color_string);
- if (!background_color_string.empty()) {
- if (background_color_string[0] == '#') {
- background_color_ = static_cast<SkColor>(
- 0xff000000 | HexStringToInt(background_color_string.substr(1)));
- } else {
- // Literal color constants are not supported yet.
- return false;
- }
- }
- root->GetString(kRegistrationUrlAttr, &registration_url_);
- ListValue* setup_content_value = NULL;
- root->GetList(kSetupContentAttr, &setup_content_value);
- if (setup_content_value != NULL) {
- for (ListValue::const_iterator iter = setup_content_value->begin();
- iter != setup_content_value->end();
- ++iter) {
- const DictionaryValue* dict = NULL;
- dict = static_cast<const DictionaryValue*>(*iter);
- DCHECK(dict->GetType() == Value::TYPE_DICTIONARY);
- std::string content_locale;
- if (!dict->GetString(kContentLocaleAttr, &content_locale))
- return false;
- SetupContent content;
- if (!dict->GetString(kHelpPageAttr, &content.help_page_path))
- return false;
- if (!dict->GetString(kEulaPageAttr, &content.eula_page_path))
- return false;
- setup_content_[content_locale] = content;
- }
- }
- return true;
-}
-
-const StartupCustomizationDocument::SetupContent*
- StartupCustomizationDocument::GetSetupContent(
- const std::string& locale) const {
- SetupContentMap::const_iterator content_iter = setup_content_.find(locale);
- if (content_iter != setup_content_.end()) {
- return &content_iter->second;
- }
- return NULL;
-}
-
-// ServicesCustomizationDocument implementation.
-
-bool ServicesCustomizationDocument::ParseFromJsonValue(
- const DictionaryValue* root) {
- return CustomizationDocument::ParseFromJsonValue(root);
- // TODO(denisromanov): implement.
-}
-
-} // namespace chromeos