Commit a3c400b9 authored by sail@chromium.org's avatar sail@chromium.org

Sync Promo: Update sign into sync Wrench menu item

When not signed in the wrench menu says "Sign in to Chrome". When signed in it says "Signed in to Chrome as pat@example.com".

BUG=91009
TEST=Ran and verified that the wrench menu updated after signing into sync.


Review URL: http://codereview.chromium.org/7604017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96225 0039d316-1c4b-4281-b951-d872f2087c98
parent 36fc0fe0
...@@ -8466,15 +8466,25 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -8466,15 +8466,25 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message> </message>
<if expr="pp_ifdef('use_titlecase')"> <if expr="pp_ifdef('use_titlecase')">
<message name="IDS_SHOW_SYNC_SETUP" desc="In title case. The title of the menu item to open the sync setup page. Shown in the Wrench menu."> <message name="IDS_SHOW_SYNC_SETUP" desc="In title case. The title of the menu item to open the sync setup page. Shown in the Wrench menu.">
Set Up <ph name="SHORT_PRODUCT_NAME">$1<ex>Chrome</ex></ph> Sync Sign in to <ph name="SHORT_PRODUCT_NAME">$1<ex>Chrome</ex></ph>
</message> </message>
</if> </if>
<if expr="not pp_ifdef('use_titlecase')"> <if expr="not pp_ifdef('use_titlecase')">
<message name="IDS_SHOW_SYNC_SETUP" desc="The title of the menu item to open the sync setup page. Shown in the Wrench menu."> <message name="IDS_SHOW_SYNC_SETUP" desc="The title of the menu item to open the sync setup page. Shown in the Wrench menu.">
Set up <ph name="SHORT_PRODUCT_NAME">$1<ex>Chrome</ex></ph> sync Sign in to <ph name="SHORT_PRODUCT_NAME">$1<ex>Chrome</ex></ph>
</message> </message>
</if> </if>
<!-- SafeBrowsing --> <if expr="pp_ifdef('use_titlecase')">
<message name="IDS_SHOW_SYNC_SETUP_USERNAME" desc="In title case. The title of the menu item to open the sync setup page. Shown in the Wrench menu when the user is signed into sync.">
Signed in to <ph name="SHORT_PRODUCT_NAME">$1<ex>Chrome</ex></ph> as <ph name="USER_NAME">$2<ex>pat@example.com</ex></ph>
</message>
</if>
<if expr="not pp_ifdef('use_titlecase')">
<message name="IDS_SHOW_SYNC_SETUP_USERNAME" desc="The title of the menu item to open the sync setup page. Shown in the Wrench menu when the user is signed into sync.">
Signed in to <ph name="SHORT_PRODUCT_NAME">$1<ex>Chrome</ex></ph> as <ph name="USER_NAME">$2<ex>pat@example.com</ex></ph>
</message>
</if>
<!-- SafeBrowsing -->
<message name="IDS_SAFE_BROWSING_MALWARE_TITLE" desc="SafeBrowsing Malware HTML title"> <message name="IDS_SAFE_BROWSING_MALWARE_TITLE" desc="SafeBrowsing Malware HTML title">
Malware Detected! Malware Detected!
</message> </message>
......
...@@ -245,7 +245,8 @@ bool WrenchMenuModel::IsItemForCommandIdDynamic(int command_id) const { ...@@ -245,7 +245,8 @@ bool WrenchMenuModel::IsItemForCommandIdDynamic(int command_id) const {
#endif #endif
command_id == IDC_SYNC_BOOKMARKS || command_id == IDC_SYNC_BOOKMARKS ||
command_id == IDC_VIEW_BACKGROUND_PAGES || command_id == IDC_VIEW_BACKGROUND_PAGES ||
command_id == IDC_UPGRADE_DIALOG; command_id == IDC_UPGRADE_DIALOG ||
command_id == IDC_SHOW_SYNC_SETUP;
} }
string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const { string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const {
...@@ -279,6 +280,19 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const { ...@@ -279,6 +280,19 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const {
return l10n_util::GetStringFUTF16(IDS_UPDATE_NOW, product_name); return l10n_util::GetStringFUTF16(IDS_UPDATE_NOW, product_name);
} }
case IDC_SHOW_SYNC_SETUP: {
std::string username = browser_->GetProfile()->GetPrefs()->GetString(
prefs::kGoogleServicesUsername);
string16 short_product_name =
l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
if (username.empty()) {
return l10n_util::GetStringFUTF16(IDS_SHOW_SYNC_SETUP,
short_product_name);
}
return l10n_util::GetStringFUTF16(IDS_SHOW_SYNC_SETUP_USERNAME,
short_product_name,
UTF8ToUTF16(username));
}
default: default:
NOTREACHED(); NOTREACHED();
return string16(); return string16();
......
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