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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 8698010: Clear cache after showing Sync confirmation bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/ntp/ntp_login_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index c1a007f96bd88c352c32a60631d396d6e684ff00..1629e736d4b2ca175655599d543944430bc6685f 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -29,6 +29,7 @@
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_service.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -125,6 +126,12 @@ void NTPLoginHandler::RecordInHistogram(int type) {
void NTPLoginHandler::HandleLoginMessageSeen(const ListValue* args) {
Profile::FromWebUI(web_ui_)->GetPrefs()->SetBoolean(
prefs::kSyncPromoShowNTPBubble, false);
+
+ content::NotificationService* service =
+ content::NotificationService::current();
+ service->Notify(chrome::NTP4_SYNC_PROMO_SHOW_NTP_BUBBLE_CHANGED,
+ content::Source<NTPLoginHandler>(this),
+ content::NotificationService::NoDetails());
}
void NTPLoginHandler::HandleShowAdvancedLoginUI(const ListValue* args) {
@@ -178,6 +185,10 @@ bool NTPLoginHandler::ShouldShow(Profile* profile) {
// static
void NTPLoginHandler::GetLocalizedValues(Profile* profile,
DictionaryValue* values) {
+ // Always set the URL to prevent i18n missing value errors.
+ values->SetString("login_status_url",
+ google_util::StringAppendGoogleLocaleParam(chrome::kSyncLearnMoreURL));
+
PrefService* prefs = profile->GetPrefs();
if (prefs->GetString(prefs::kGoogleServicesUsername).empty() ||
!prefs->GetBoolean(prefs::kSyncPromoShowNTPBubble)) {
@@ -187,8 +198,6 @@ void NTPLoginHandler::GetLocalizedValues(Profile* profile,
values->SetString("login_status_message",
l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE,
l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
- values->SetString("login_status_url",
- google_util::StringAppendGoogleLocaleParam(chrome::kSyncLearnMoreURL));
values->SetString("login_status_learn_more",
l10n_util::GetStringUTF16(IDS_LEARN_MORE));
values->SetString("login_status_advanced",
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698