Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Turn on flag to check cookies when updating NTP Promo.
Review URL: http://codereview.chromium.org/8772063

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113049 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
caitkp@chromium.org committed Dec 5, 2011
1 parent 2e6f115 commit 3a3a0fa
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions chrome/browser/web_resource/promo_resource_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ namespace {
static const int kStartResourceFetchDelay = 5000;

// Delay between calls to update the cache (48 hours), and 3 min in debug mode.
static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000;
static const int kTestCacheUpdateDelay = 3 * 60 * 1000;
static const int kCacheUpdateDelay = 1 * 60 * 1000;
static const int kTestCacheUpdateDelay = 1 * 60 * 1000;

// The version of the service (used to expire the cache when upgrading Chrome
// to versions with different types of promos).
static const int kPromoServiceVersion = 2;
static const int kPromoServiceVersion = 7;

// The number of groups sign-in promo users will be divided into (which gives us
// a 1/N granularity when targeting more groups).
Expand All @@ -49,11 +49,14 @@ static const char kWebStoreLinkProperty[] = "inproduct";
static const char kWebStoreExpireProperty[] = "tooltip";

const char* GetPromoResourceURL() {
const char* kCaitPromoResourceServer =
"http://caitkp-desktop.mon.corp.google.com/promo.js?";
std::string promo_server_url = CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kPromoServerURL);
return promo_server_url.empty() ?
PromoResourceService::kDefaultPromoResourceServer :
promo_server_url.c_str();
kCaitPromoResourceServer;
//promo_server_url.c_str();
}

bool IsTest() {
Expand All @@ -70,6 +73,8 @@ int GetCacheUpdateDelay() {
const char* PromoResourceService::kDefaultPromoResourceServer =
"https://www.google.com/support/chrome/bin/topic/1142433/inproduct?hl=";



// static
void PromoResourceService::RegisterPrefs(PrefService* local_state) {
local_state->RegisterIntegerPref(prefs::kNTPPromoVersion, 0);
Expand Down Expand Up @@ -127,7 +132,7 @@ bool PromoResourceService::IsBuildTargeted(chrome::VersionInfo::Channel channel,
PromoResourceService::PromoResourceService(Profile* profile)
: WebResourceService(profile->GetPrefs(),
GetPromoResourceURL(),
true, // append locale to URL
false,//true, // append locale to URL
chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED,
prefs::kNTPPromoResourceCacheUpdate,
kStartResourceFetchDelay,
Expand Down Expand Up @@ -220,7 +225,7 @@ void PromoResourceService::UnpackNotificationSignal(
const DictionaryValue& parsed_json) {
scoped_refptr<NotificationPromo> notification_promo =
NotificationPromo::Create(profile_, this);
notification_promo->InitFromJson(parsed_json, false);
notification_promo->InitFromJson(parsed_json, true);
}

bool PromoResourceService::CanShowNotificationPromo(Profile* profile) {
Expand Down

0 comments on commit 3a3a0fa

Please sign in to comment.