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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 case platform_util::CHANNEL_BETA: | 105 case platform_util::CHANNEL_BETA: |
106 return (BETA_BUILD & builds_allowed) != 0; | 106 return (BETA_BUILD & builds_allowed) != 0; |
107 case platform_util::CHANNEL_STABLE: | 107 case platform_util::CHANNEL_STABLE: |
108 return (STABLE_BUILD & builds_allowed) != 0; | 108 return (STABLE_BUILD & builds_allowed) != 0; |
109 default: | 109 default: |
110 return false; | 110 return false; |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 PromoResourceService::PromoResourceService(Profile* profile) | 114 PromoResourceService::PromoResourceService(Profile* profile) |
115 : WebResourceService(profile->GetPrefs(), | 115 : WebResourceService(profile, |
| 116 profile->GetPrefs(), |
116 PromoResourceService::kDefaultPromoResourceServer, | 117 PromoResourceService::kDefaultPromoResourceServer, |
117 true, // append locale to URL | 118 true, // append locale to URL |
118 NotificationType::PROMO_RESOURCE_STATE_CHANGED, | 119 NotificationType::PROMO_RESOURCE_STATE_CHANGED, |
119 prefs::kNTPPromoResourceCacheUpdate, | 120 prefs::kNTPPromoResourceCacheUpdate, |
120 kStartResourceFetchDelay, | 121 kStartResourceFetchDelay, |
121 kCacheUpdateDelay), | 122 kCacheUpdateDelay), |
122 web_resource_cache_(NULL), | 123 web_resource_cache_(NULL), |
123 channel_(platform_util::CHANNEL_UNKNOWN) { | 124 channel_(platform_util::CHANNEL_UNKNOWN) { |
124 Init(); | 125 Init(); |
125 } | 126 } |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 base::ThreadRestrictions::ScopedAllowIO allow_io; | 477 base::ThreadRestrictions::ScopedAllowIO allow_io; |
477 platform_util::Channel channel = platform_util::GetChannel(); | 478 platform_util::Channel channel = platform_util::GetChannel(); |
478 is_promo_build = PromoResourceService::IsBuildTargeted( | 479 is_promo_build = PromoResourceService::IsBuildTargeted( |
479 channel, prefs->GetInteger(prefs::kNTPPromoBuild)); | 480 channel, prefs->GetInteger(prefs::kNTPPromoBuild)); |
480 } | 481 } |
481 | 482 |
482 return !promo_closed && !is_synced && is_promo_build; | 483 return !promo_closed && !is_synced && is_promo_build; |
483 } | 484 } |
484 | 485 |
485 } // namespace PromoResourceServiceUtil | 486 } // namespace PromoResourceServiceUtil |
OLD | NEW |