Commit 3a3a0faa authored by caitkp@chromium.org's avatar caitkp@chromium.org

Small tweak to http://codereview.chromium.org/8520009/:

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
parent 2e6f1159
...@@ -30,12 +30,12 @@ namespace { ...@@ -30,12 +30,12 @@ namespace {
static const int kStartResourceFetchDelay = 5000; static const int kStartResourceFetchDelay = 5000;
// Delay between calls to update the cache (48 hours), and 3 min in debug mode. // 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 kCacheUpdateDelay = 1 * 60 * 1000;
static const int kTestCacheUpdateDelay = 3 * 60 * 1000; static const int kTestCacheUpdateDelay = 1 * 60 * 1000;
// The version of the service (used to expire the cache when upgrading Chrome // The version of the service (used to expire the cache when upgrading Chrome
// to versions with different types of promos). // 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 // The number of groups sign-in promo users will be divided into (which gives us
// a 1/N granularity when targeting more groups). // a 1/N granularity when targeting more groups).
...@@ -49,11 +49,14 @@ static const char kWebStoreLinkProperty[] = "inproduct"; ...@@ -49,11 +49,14 @@ static const char kWebStoreLinkProperty[] = "inproduct";
static const char kWebStoreExpireProperty[] = "tooltip"; static const char kWebStoreExpireProperty[] = "tooltip";
const char* GetPromoResourceURL() { const char* GetPromoResourceURL() {
const char* kCaitPromoResourceServer =
"http://caitkp-desktop.mon.corp.google.com/promo.js?";
std::string promo_server_url = CommandLine::ForCurrentProcess()-> std::string promo_server_url = CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kPromoServerURL); GetSwitchValueASCII(switches::kPromoServerURL);
return promo_server_url.empty() ? return promo_server_url.empty() ?
PromoResourceService::kDefaultPromoResourceServer : PromoResourceService::kDefaultPromoResourceServer :
promo_server_url.c_str(); kCaitPromoResourceServer;
//promo_server_url.c_str();
} }
bool IsTest() { bool IsTest() {
...@@ -70,6 +73,8 @@ int GetCacheUpdateDelay() { ...@@ -70,6 +73,8 @@ int GetCacheUpdateDelay() {
const char* PromoResourceService::kDefaultPromoResourceServer = const char* PromoResourceService::kDefaultPromoResourceServer =
"https://www.google.com/support/chrome/bin/topic/1142433/inproduct?hl="; "https://www.google.com/support/chrome/bin/topic/1142433/inproduct?hl=";
// static // static
void PromoResourceService::RegisterPrefs(PrefService* local_state) { void PromoResourceService::RegisterPrefs(PrefService* local_state) {
local_state->RegisterIntegerPref(prefs::kNTPPromoVersion, 0); local_state->RegisterIntegerPref(prefs::kNTPPromoVersion, 0);
...@@ -127,7 +132,7 @@ bool PromoResourceService::IsBuildTargeted(chrome::VersionInfo::Channel channel, ...@@ -127,7 +132,7 @@ bool PromoResourceService::IsBuildTargeted(chrome::VersionInfo::Channel channel,
PromoResourceService::PromoResourceService(Profile* profile) PromoResourceService::PromoResourceService(Profile* profile)
: WebResourceService(profile->GetPrefs(), : WebResourceService(profile->GetPrefs(),
GetPromoResourceURL(), GetPromoResourceURL(),
true, // append locale to URL false,//true, // append locale to URL
chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED, chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED,
prefs::kNTPPromoResourceCacheUpdate, prefs::kNTPPromoResourceCacheUpdate,
kStartResourceFetchDelay, kStartResourceFetchDelay,
...@@ -220,7 +225,7 @@ void PromoResourceService::UnpackNotificationSignal( ...@@ -220,7 +225,7 @@ void PromoResourceService::UnpackNotificationSignal(
const DictionaryValue& parsed_json) { const DictionaryValue& parsed_json) {
scoped_refptr<NotificationPromo> notification_promo = scoped_refptr<NotificationPromo> notification_promo =
NotificationPromo::Create(profile_, this); NotificationPromo::Create(profile_, this);
notification_promo->InitFromJson(parsed_json, false); notification_promo->InitFromJson(parsed_json, true);
} }
bool PromoResourceService::CanShowNotificationPromo(Profile* profile) { bool PromoResourceService::CanShowNotificationPromo(Profile* profile) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment