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 #include "chrome/browser/chromeos/mobile_config.h" | 5 #include "chrome/browser/chromeos/mobile_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chromeos/login/startup_utils.h" | 17 #include "chrome/browser/chromeos/login/startup_utils.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 | 19 |
20 using content::BrowserThread; | 20 using content::BrowserThread; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Config attributes names. | 24 // Config attributes names. |
25 const char kVersionAttr[] = "version"; | |
26 const char kAcceptedConfigVersion[] = "1.0"; | 25 const char kAcceptedConfigVersion[] = "1.0"; |
27 const char kDefaultAttr[] = "default"; | 26 const char kDefaultAttr[] = "default"; |
28 | 27 |
29 // Carrier config attributes. | 28 // Carrier config attributes. |
30 const char kCarriersAttr[] = "carriers"; | 29 const char kCarriersAttr[] = "carriers"; |
31 const char kCarrierIdsAttr[] = "ids"; | 30 const char kCarrierIdsAttr[] = "ids"; |
32 const char kCarrierIdAttr[] = "id"; | 31 const char kCarrierIdAttr[] = "id"; |
33 const char kTopUpURLAttr[] = "top_up_url"; | 32 const char kTopUpURLAttr[] = "top_up_url"; |
34 const char kShowPortalButtonAttr[] = "show_portal_button"; | 33 const char kShowPortalButtonAttr[] = "show_portal_button"; |
35 const char kDealsAttr[] = "deals"; | 34 const char kDealsAttr[] = "deals"; |
36 | 35 |
37 // Carrier deal attributes. | 36 // Carrier deal attributes. |
38 const char kDealIdAttr[] = "deal_id"; | 37 const char kDealIdAttr[] = "deal_id"; |
39 const char kDealLocalesAttr[] = "locales"; | 38 const char kDealLocalesAttr[] = "locales"; |
40 | 39 |
41 const char kInfoURLAttr[] = "info_url"; | 40 const char kInfoURLAttr[] = "info_url"; |
42 const char kNotificationCountAttr[] = "notification_count"; | 41 const char kNotificationCountAttr[] = "notification_count"; |
43 const char kDealExpireDateAttr[] = "expire_date"; | 42 const char kDealExpireDateAttr[] = "expire_date"; |
44 const char kLocalizedContentAttr[] = "localized_content"; | 43 const char kLocalizedContentAttr[] = "localized_content"; |
45 const char kNotificationTextAttr[] = "notification_text"; | |
46 | 44 |
47 // Initial locale carrier config attributes. | 45 // Initial locale carrier config attributes. |
48 const char kInitialLocalesAttr[] = "initial_locales"; | 46 const char kInitialLocalesAttr[] = "initial_locales"; |
49 const char kSetupURLAttr[] = "setup_url"; | 47 const char kSetupURLAttr[] = "setup_url"; |
50 | 48 |
51 // Local config properties. | 49 // Local config properties. |
52 const char kExcludeDealsAttr[] = "exclude_deals"; | 50 const char kExcludeDealsAttr[] = "exclude_deals"; |
53 | 51 |
54 // Location of the global carrier config. | 52 // Location of the global carrier config. |
55 const char kGlobalCarrierConfigPath[] = | 53 const char kGlobalCarrierConfigPath[] = |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 << local_config_file.value(); | 367 << local_config_file.value(); |
370 } | 368 } |
371 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 369 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
372 base::Bind(&MobileConfig::ProcessConfig, | 370 base::Bind(&MobileConfig::ProcessConfig, |
373 base::Unretained(this), // singleton. | 371 base::Unretained(this), // singleton. |
374 global_config, | 372 global_config, |
375 local_config)); | 373 local_config)); |
376 } | 374 } |
377 | 375 |
378 } // namespace chromeos | 376 } // namespace chromeos |
OLD | NEW |