OLD | NEW |
(Empty) | |
| 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 #ifndef CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
| 7 |
| 8 #include <list> |
| 9 #include <map> |
| 10 #include <string> |
| 11 |
| 12 #include "base/basictypes.h" |
| 13 #include "base/scoped_ptr.h" |
| 14 #include "third_party/skia/include/core/SkColor.h" |
| 15 |
| 16 class DictionaryValue; |
| 17 class FilePath; |
| 18 |
| 19 namespace chromeos { |
| 20 |
| 21 class CustomizationDocument { |
| 22 public: |
| 23 CustomizationDocument() {} |
| 24 virtual ~CustomizationDocument() {} |
| 25 |
| 26 virtual bool LoadManifestFromFile(const FilePath& manifest_path); |
| 27 virtual bool LoadManifestFromString(const std::string& manifest); |
| 28 |
| 29 const std::string& version() const { return version_; } |
| 30 |
| 31 protected: |
| 32 // Parses manifest's attributes from the JSON dictionary value. |
| 33 virtual bool ParseFromJsonValue(const DictionaryValue* root); |
| 34 |
| 35 // Manifest version string. |
| 36 std::string version_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(CustomizationDocument); |
| 39 }; |
| 40 |
| 41 class StartupCustomizationDocument : public CustomizationDocument { |
| 42 public: |
| 43 struct SetupContent { |
| 44 SetupContent() {} |
| 45 SetupContent(const std::string& help_page_path, |
| 46 const std::string& eula_page_path) |
| 47 : help_page_path(help_page_path), |
| 48 eula_page_path(eula_page_path) {} |
| 49 |
| 50 // Partner's help page for specific locale. |
| 51 std::string help_page_path; |
| 52 // Partner's EULA for specific locale. |
| 53 std::string eula_page_path; |
| 54 }; |
| 55 |
| 56 typedef std::map<std::string, SetupContent> SetupContentMap; |
| 57 |
| 58 StartupCustomizationDocument() {} |
| 59 |
| 60 const std::string& product_sku() const { return product_sku_; } |
| 61 const std::string& initial_locale() const { return initial_locale_; } |
| 62 SkColor background_color() const { return background_color_; } |
| 63 const std::string& registration_url() const { return registration_url_; } |
| 64 |
| 65 const SetupContent* GetSetupContent(const std::string& locale) const; |
| 66 |
| 67 protected: |
| 68 virtual bool ParseFromJsonValue(const DictionaryValue* root); |
| 69 |
| 70 // Product SKU. |
| 71 std::string product_sku_; |
| 72 |
| 73 // Initial locale for the OOBE wizard. |
| 74 std::string initial_locale_; |
| 75 |
| 76 // OOBE wizard and login screen background color. |
| 77 SkColor background_color_; |
| 78 |
| 79 // Partner's product registration page URL. |
| 80 std::string registration_url_; |
| 81 |
| 82 // Setup content for different locales. |
| 83 SetupContentMap setup_content_; |
| 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(StartupCustomizationDocument); |
| 86 }; |
| 87 |
| 88 class ServicesCustomizationDocument : public CustomizationDocument { |
| 89 public: |
| 90 ServicesCustomizationDocument() {} |
| 91 |
| 92 protected: |
| 93 virtual bool ParseFromJsonValue(const DictionaryValue* root); |
| 94 |
| 95 // Partner's welcome page that is opened right after the OOBE. |
| 96 std::string initial_start_page_; |
| 97 |
| 98 // Title for the partner's apps section in apps menu. |
| 99 std::string app_menu_section_title_; |
| 100 |
| 101 // Partner's featured apps URLs. |
| 102 std::list<std::string> web_apps_; |
| 103 |
| 104 // Partner's featured extensions URLs. |
| 105 std::list<std::string> extensions_; |
| 106 |
| 107 // Partner's apps section support page URL. |
| 108 std::string app_menu_support_page_url_; |
| 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument); |
| 111 }; |
| 112 |
| 113 } // namespace chromeos |
| 114 |
| 115 #endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
OLD | NEW |