OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/web_resource/promo_resource_service.h" | 5 #include "chrome/browser/web_resource/promo_resource_service.h" |
6 | 6 |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Users are randomly assigned to one of kNTPPromoGroupSize buckets, in order | 31 // Users are randomly assigned to one of kNTPPromoGroupSize buckets, in order |
32 // to be able to roll out promos slowly, or display different promos to | 32 // to be able to roll out promos slowly, or display different promos to |
33 // different groups. | 33 // different groups. |
34 static const int kNTPPromoGroupSize = 16; | 34 static const int kNTPPromoGroupSize = 16; |
35 | 35 |
36 // Maximum number of hours for each time slice (4 weeks). | 36 // Maximum number of hours for each time slice (4 weeks). |
37 static const int kMaxTimeSliceHours = 24 * 7 * 4; | 37 static const int kMaxTimeSliceHours = 24 * 7 * 4; |
38 | 38 |
39 // The version of the service (used to expire the cache when upgrading Chrome | 39 // The version of the service (used to expire the cache when upgrading Chrome |
40 // to versions with different types of promos). | 40 // to versions with different types of promos). |
41 static const int kPromoServiceVersion = 1; | 41 static const int kPromoServiceVersion = 2; |
42 | 42 |
43 // Properties used by the server. | 43 // Properties used by the server. |
44 static const char kAnswerIdProperty[] = "answer_id"; | 44 static const char kAnswerIdProperty[] = "answer_id"; |
45 static const char kWebStoreHeaderProperty[] = "question"; | 45 static const char kWebStoreHeaderProperty[] = "question"; |
46 static const char kWebStoreButtonProperty[] = "inproduct_target"; | 46 static const char kWebStoreButtonProperty[] = "inproduct_target"; |
47 static const char kWebStoreLinkProperty[] = "inproduct"; | 47 static const char kWebStoreLinkProperty[] = "inproduct"; |
48 static const char kWebStoreExpireProperty[] = "tooltip"; | 48 static const char kWebStoreExpireProperty[] = "tooltip"; |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 base::ThreadRestrictions::ScopedAllowIO allow_io; | 477 base::ThreadRestrictions::ScopedAllowIO allow_io; |
478 platform_util::Channel channel = platform_util::GetChannel(); | 478 platform_util::Channel channel = platform_util::GetChannel(); |
479 is_promo_build = PromoResourceService::IsBuildTargeted( | 479 is_promo_build = PromoResourceService::IsBuildTargeted( |
480 channel, prefs->GetInteger(prefs::kNTPPromoBuild)); | 480 channel, prefs->GetInteger(prefs::kNTPPromoBuild)); |
481 } | 481 } |
482 | 482 |
483 return !promo_closed && !is_synced && is_promo_build; | 483 return !promo_closed && !is_synced && is_promo_build; |
484 } | 484 } |
485 | 485 |
486 } // namespace PromoResourceServiceUtil | 486 } // namespace PromoResourceServiceUtil |
OLD | NEW |