Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: chrome/browser/web_resource/promo_resource_service.cc

Issue 7104063: [NTP] Refresh promo when users upgrade from M12 to M13. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698