OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
Nikita (slow)
2014/01/30 13:23:28
<vector>
Alexander Alekseev
2014/01/31 12:46:54
Done.
| |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "net/url_request/url_fetcher_delegate.h" | 16 #include "net/url_request/url_fetcher_delegate.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 public: | 69 public: |
70 static StartupCustomizationDocument* GetInstance(); | 70 static StartupCustomizationDocument* GetInstance(); |
71 | 71 |
72 std::string GetHelpPage(const std::string& locale) const; | 72 std::string GetHelpPage(const std::string& locale) const; |
73 std::string GetEULAPage(const std::string& locale) const; | 73 std::string GetEULAPage(const std::string& locale) const; |
74 | 74 |
75 const std::string& registration_url() const { return registration_url_; } | 75 const std::string& registration_url() const { return registration_url_; } |
76 | 76 |
77 // These methods can be called even if !IsReady(), in this case VPD values | 77 // These methods can be called even if !IsReady(), in this case VPD values |
78 // will be returned. | 78 // will be returned. |
79 // | |
80 // Raw value of "initial_locale" like initial_locale="en-US,sv,da,fi,no" . | |
79 const std::string& initial_locale() const { return initial_locale_; } | 81 const std::string& initial_locale() const { return initial_locale_; } |
82 // Vector of individual locale values. | |
Nikita (slow)
2014/01/30 13:23:28
nit: Insert empty line before comment (same below)
Alexander Alekseev
2014/01/31 12:46:54
Done.
| |
83 const std::vector<std::string>& configured_locales() const; | |
84 // configured_locales().front() - default locale value. | |
Nikita (slow)
2014/01/30 13:23:28
Please rewrite comment and remove configured_local
Alexander Alekseev
2014/01/31 12:46:54
Done.
| |
85 const std::string& initial_locale_default() const; | |
80 const std::string& initial_timezone() const { return initial_timezone_; } | 86 const std::string& initial_timezone() const { return initial_timezone_; } |
81 const std::string& keyboard_layout() const { return keyboard_layout_; } | 87 const std::string& keyboard_layout() const { return keyboard_layout_; } |
82 | 88 |
83 private: | 89 private: |
84 FRIEND_TEST_ALL_PREFIXES(StartupCustomizationDocumentTest, Basic); | 90 FRIEND_TEST_ALL_PREFIXES(StartupCustomizationDocumentTest, Basic); |
85 FRIEND_TEST_ALL_PREFIXES(StartupCustomizationDocumentTest, VPD); | 91 FRIEND_TEST_ALL_PREFIXES(StartupCustomizationDocumentTest, VPD); |
86 FRIEND_TEST_ALL_PREFIXES(StartupCustomizationDocumentTest, BadManifest); | 92 FRIEND_TEST_ALL_PREFIXES(StartupCustomizationDocumentTest, BadManifest); |
87 friend struct DefaultSingletonTraits<StartupCustomizationDocument>; | 93 friend struct DefaultSingletonTraits<StartupCustomizationDocument>; |
88 | 94 |
89 // C-tor for singleton construction. | 95 // C-tor for singleton construction. |
90 StartupCustomizationDocument(); | 96 StartupCustomizationDocument(); |
91 | 97 |
92 // C-tor for test construction. | 98 // C-tor for test construction. |
93 StartupCustomizationDocument(system::StatisticsProvider* provider, | 99 StartupCustomizationDocument(system::StatisticsProvider* provider, |
94 const std::string& manifest); | 100 const std::string& manifest); |
95 | 101 |
96 virtual ~StartupCustomizationDocument(); | 102 virtual ~StartupCustomizationDocument(); |
97 | 103 |
98 void Init(system::StatisticsProvider* provider); | 104 void Init(system::StatisticsProvider* provider); |
99 | 105 |
100 // If |attr| exists in machine stat, assign it to |value|. | 106 // If |attr| exists in machine stat, assign it to |value|. |
101 void InitFromMachineStatistic(const char* attr, std::string* value); | 107 void InitFromMachineStatistic(const char* attr, std::string* value); |
102 | 108 |
103 std::string initial_locale_; | 109 std::string initial_locale_; |
110 std::vector<std::string> configured_locales_; | |
104 std::string initial_timezone_; | 111 std::string initial_timezone_; |
105 std::string keyboard_layout_; | 112 std::string keyboard_layout_; |
106 std::string registration_url_; | 113 std::string registration_url_; |
107 | 114 |
108 DISALLOW_COPY_AND_ASSIGN(StartupCustomizationDocument); | 115 DISALLOW_COPY_AND_ASSIGN(StartupCustomizationDocument); |
109 }; | 116 }; |
110 | 117 |
111 // OEM services customization document class. | 118 // OEM services customization document class. |
112 // ServicesCustomizationDocument is fetched from network or local file but on | 119 // ServicesCustomizationDocument is fetched from network or local file but on |
113 // FILE thread therefore it may not be ready just after creation. Fetching of | 120 // FILE thread therefore it may not be ready just after creation. Fetching of |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 | 178 |
172 // How many times we already tried to fetch customization manifest file. | 179 // How many times we already tried to fetch customization manifest file. |
173 int num_retries_; | 180 int num_retries_; |
174 | 181 |
175 DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument); | 182 DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument); |
176 }; | 183 }; |
177 | 184 |
178 } // namespace chromeos | 185 } // namespace chromeos |
179 | 186 |
180 #endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ | 187 #endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
OLD | NEW |