r266847 - in trunk/src/chrome: app browser/resources/chromeos browser/resources/ntp4 browser/ui/webui/ntp

79 views
Skip to first unread message

edwar...@chromium.org

unread,
Apr 29, 2014, 7:23:22 AM4/29/14
to chromium...@chromium.org
Author: edwar...@chromium.org
Date: Tue Apr 29 04:23:21 2014
New Revision: 266847

Log:
Update incognito and guest browsing new tab page:
+ Updated styling.
+ Add new incognito man illustration.
+ Simplify the copy. Remove the extensions block.


BUG=356226

Review URL: https://codereview.chromium.org/208683007

Added:
trunk/src/chrome/browser/resources/ntp4/incognito_and_guest_tab.css (contents, props changed)
Modified:
trunk/src/chrome/app/generated_resources.grd
trunk/src/chrome/browser/resources/chromeos/guest_session_tab.html
trunk/src/chrome/browser/resources/ntp4/guest_tab.html
trunk/src/chrome/browser/resources/ntp4/incognito_tab.css
trunk/src/chrome/browser/resources/ntp4/incognito_tab.html
trunk/src/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Modified: trunk/src/chrome/app/generated_resources.grd
==============================================================================
--- trunk/src/chrome/app/generated_resources.grd (original)
+++ trunk/src/chrome/app/generated_resources.grd Tue Apr 29 04:23:21 2014
@@ -11091,29 +11091,40 @@
<message name="IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL" desc="URL of help center page explaining what the 'Other Sessions' menu is.">
http://support.google.com/chrome/bin/answer.py?answer=185277&amp;hl=[GRITLANGCODE]
</message>
- <message name="IDS_NEW_TAB_OTR_MESSAGE"
+ <message name="IDS_NEW_TAB_OTR_HEADING"
+ desc="Heading used when a person opens an OTR window">
+ You’ve gone incognito
+ </message>
+ <message name="IDS_NEW_TAB_OTR_DESCRIPTION"
desc="Used when a person opens an OTR window">
- <ph name="BEGIN_BOLD">&lt;strong&gt;</ph>You've gone incognito.<ph name="END_BOLD">&lt;/strong&gt;</ph>
- Pages you view in incognito tabs won't stick around in your browser's history, cookie store, or search history after you've closed <ph name="BEGIN_BOLD">&lt;strong&gt;</ph>all<ph name="END_BOLD">&lt;/strong&gt;</ph> of your incognito tabs. Any files you download or bookmarks you create will be kept.
- <ph name="LINE_BREAK">&lt;br /&gt;&lt;br /&gt;<ex>&lt;br /&gt;&lt;br /&gt;</ex></ph>
- <ph name="BEGIN_BOLD">&lt;strong&gt;</ph>However, you aren't invisible.<ph name="END_BOLD">&lt;/strong&gt;</ph> Going incognito doesn't hide your browsing from your employer, your internet service provider, governments and other sophisticated attackers, or the websites you visit.
- <ph name="LINE_BREAK">&lt;br /&gt;&lt;br /&gt;<ex>&lt;br /&gt;&lt;br /&gt;</ex></ph>
- <ph name="BEGIN_LINK">&lt;a href="$1"&gt;</ph>Learn more<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> about incognito browsing.
+ Pages you view in incognito tabs won’t stick around in your browser’s history, cookie store, or search history after you’ve closed <ph name="BEGIN_BOLD">&lt;strong&gt;</ph>all<ph name="END_BOLD">&lt;/strong&gt;</ph> of your incognito tabs. Any files you download or bookmarks you create will be kept.
+ </message>
+ <message name="IDS_NEW_TAB_OTR_LEARN_MORE_LINK"
+ desc="OTR window link text to learn more">
+ Learn more about incognito browsing
+ </message>
+ <message name="IDS_NEW_TAB_OTR_MESSAGE_WARNING"
+ desc="OTR window warning message">
+ Going incognito doesn’t hide your browsing from your employer, your internet service provider, or the websites you visit.
+ </message>
+ <message name="IDS_NEW_TAB_GUEST_SESSION_HEADING"
+ desc="Heading used when a person enters Guest Session">
+ You’re browsing as a Guest
+ </message>
+ <message name="IDS_NEW_TAB_GUEST_SESSION_LEARN_MORE_LINK"
+ desc="Guest Session link text to learn more">
+ Learn more about Guest browsing
</message>
<if expr="chromeos">
- <message name="IDS_NEW_TAB_GUEST_SESSION_MESSAGE"
+ <message name="IDS_NEW_TAB_GUEST_SESSION_DESCRIPTION"
desc="Used when a person enters Guest Session">
- <ph name="BEGIN_BOLD">&lt;strong&gt;</ph>You're browsing as a Guest<ph name="END_BOLD">&lt;/strong&gt;</ph>. Pages you view in this window won't appear in the browser history and they won't leave other traces, like cookies, on the computer after you sign out. Files you download and bookmarks you create won't be preserved.
- <ph name="LINE_BREAK">&lt;br /&gt;&lt;br /&gt;<ex>&lt;br /&gt;&lt;br /&gt;</ex></ph>
- <ph name="BEGIN_LINK">&lt;a href="$1"&gt;</ph>Learn more<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> about Guest browsing.
+ Pages you view in this window won’t appear in the browser history and they won’t leave other traces, like cookies, on the computer after you sign out. Files you download and bookmarks you create won’t be preserved.
</message>
</if>
<if expr="not chromeos">
- <message name="IDS_NEW_TAB_GUEST_SESSION_MESSAGE"
+ <message name="IDS_NEW_TAB_GUEST_SESSION_DESCRIPTION"
desc="Used when a person enters Guest Session">
- <ph name="BEGIN_BOLD">&lt;strong&gt;</ph>You're browsing as a Guest<ph name="END_BOLD">&lt;/strong&gt;</ph>. Pages you view in this window won't appear in the browser history and they won't leave other traces, like cookies, on the computer after you close all open Guest windows. Any files you download will be preserved, however.
- <ph name="LINE_BREAK">&lt;br /&gt;&lt;br /&gt;<ex>&lt;br /&gt;&lt;br /&gt;</ex></ph>
- <ph name="BEGIN_LINK">&lt;a href="$1"&gt;</ph>Learn more<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> about Guest browsing.
+ Pages you view in this window won’t appear in the browser history and they won’t leave other traces, like cookies, on the computer after you close all open Guest windows. Any files you download will be preserved, however.
</message>
</if>
<message name="IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE"

Modified: trunk/src/chrome/browser/resources/chromeos/guest_session_tab.html
==============================================================================
--- trunk/src/chrome/browser/resources/chromeos/guest_session_tab.html (original)
+++ trunk/src/chrome/browser/resources/chromeos/guest_session_tab.html Tue Apr 29 04:23:21 2014
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title i18n-content="title"></title>
-<link rel="stylesheet" href="../ntp4/incognito_tab.css">
+<link rel="stylesheet" href="../ntp4/incognito_and_guest_tab.css">
<link rel="stylesheet" href="login/enterprise_info.css">
<script>
// Until themes can clear the cache, force-reload the theme stylesheet.
@@ -21,8 +21,12 @@
<a id="enterprise-info-hint-link" i18n-content="learnMore"
i18n-values=".href:enterpriseInfoHintLink"></a>
</div>
-<div class="content" >
- <span i18n-values=".innerHTML:content"></span>
+<div class="content">
+ <h1 i18n-content="guestTabHeading"></h1>
+ <p>
+ <span i18n-content="guestTabDescription"></span>
+ <a i18n-content="learnMore" i18n-values=".href:learnMoreLink"></a>
+ </p>
</div>
</body>
<script>

Modified: trunk/src/chrome/browser/resources/ntp4/guest_tab.html
==============================================================================
--- trunk/src/chrome/browser/resources/ntp4/guest_tab.html (original)
+++ trunk/src/chrome/browser/resources/ntp4/guest_tab.html Tue Apr 29 04:23:21 2014
@@ -1,9 +1,9 @@
<!DOCTYPE html>
-<html i18n-values="dir:textdirection;bookmarkbarattached:bookmarkbarattached">
+<html i18n-values="dir:textdirection">
<head>
<meta charset="utf-8">
<title i18n-content="title"></title>
-<link rel="stylesheet" href="guest_tab.css">
+<link rel="stylesheet" href="incognito_and_guest_tab.css">
<script>
// Until themes can clear the cache, force-reload the theme stylesheet.
document.write('<link id="guestthemecss" rel="stylesheet" ' +
@@ -14,22 +14,18 @@
<body>
<div class="content"
i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
- <span i18n-values=".innerHTML:content"></span>
+ <h1 i18n-content="guestTabHeading"></h1>
+ <p>
+ <span i18n-content="guestTabDescription"></span>
+ <a i18n-content="learnMore" i18n-values=".href:learnMoreLink"></a>
+ </p>
</div>
</body>
<script src="chrome://resources/js/cr.js"></script>
<script>
-cr.define('ntp', function() {
- 'use strict';
-
- function themeChanged() {
- document.getElementById('guestthemecss').href =
- 'chrome://theme/css/guest_new_tab_theme.css?' + Date.now();
- }
-
- return {
- themeChanged: themeChanged,
- };
-});
+function themeChanged() {
+ document.getElementById('guestthemecss').href =
+ 'chrome://theme/css/guest_new_tab_theme.css?' + Date.now();
+}
</script>
</html>

Added: trunk/src/chrome/browser/resources/ntp4/incognito_and_guest_tab.css
==============================================================================
--- (empty file)
+++ trunk/src/chrome/browser/resources/ntp4/incognito_and_guest_tab.css Tue Apr 29 04:23:21 2014
@@ -0,0 +1,69 @@
+/* Copyright 2014 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Incognito and guest mode NTP shared CSS.
+ */
+
+html {
+ background: #fafafa;
+}
+
+body {
+ line-height: 1.5;
+}
+
+h1 {
+ font-size: 1.7em;
+ font-weight: normal;
+ line-height: 1.2em;
+ margin-top: 0;
+}
+
+a {
+ color: rgb(39, 110, 242);
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+.content {
+ background-color: white;
+ border-radius: 2px;
+ box-shadow: 0 4px 6px 1px rgba(50, 50, 50, 0.14);
+ box-sizing: border-box;
+ color: black;
+ line-height: 1.5;
+ margin: 5.5em auto 0;
+ max-width: 640px;
+ padding: 30px 35px 30px 37px;
+ width: 100%;
+}
+
+.content > span {
+ display: block;
+}
+
+.content p:last-child {
+ margin-bottom: 4px;
+}
+
+@media (max-width:700px) {
+ body {
+ margin: 3em 2em 2em;
+ }
+}
+
+@media (max-width:400px) {
+ body {
+ margin: 3em 1.5em 2em;
+ }
+}
+
+@media (max-height:480px) and (max-width:400px) {
+ .content {
+ margin: auto;
+ }
+}

Modified: trunk/src/chrome/browser/resources/ntp4/incognito_tab.css
==============================================================================
--- trunk/src/chrome/browser/resources/ntp4/incognito_tab.css (original)
+++ trunk/src/chrome/browser/resources/ntp4/incognito_tab.css Tue Apr 29 04:23:21 2014
@@ -2,50 +2,30 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */

-body {
- margin: 10px 8px;
+.content > span {
+ max-width: 416px;
}

.icon {
- -webkit-margin-end: 3px;
- -webkit-margin-start: 6px;
-}
-
-html[dir='ltr'] .icon {
- -webkit-transform: scaleX(-1);
+ -webkit-margin-after: 10px;
+ -webkit-margin-before: 4px;
+ -webkit-margin-start: 25px;
+ content: -webkit-image-set(
+ url('../../../browser/resources/ntp4/images/incognito_icon.png') 1x,
+ url('../../../browser/resources/ntp4/images/2x/incognito_icon.png') 2x);
float: right;
+ height: 128px;
+ width: 128px;
}

html[dir='rtl'] .icon {
float: left;
}

-.content {
- background-color: #eee;
- border-radius: 5px;
- color: black;
- margin-left: auto;
- margin-right: auto;
- margin-top: 66px;
- max-width: 600px;
- padding: 10px;
-}
-
-.extensions-message {
- -webkit-padding-start: 39px;
- margin-top: 15px;
- position: relative;
-}
-
-.extension-icon {
- content: -webkit-image-set(
- url('../../../app/theme/default_100_percent/extensions_section.png') 1x,
- url('../../../app/theme/default_200_percent/extensions_section.png') 2x);
- display: inline-block;
- left: 0;
- margin-top: -15px;
- position: absolute;
- right: 0;
- top: 50%;
- width: 30px;
+@media (max-width:400px) {
+ .icon {
+ -webkit-margin-start: 15px;
+ height: 96px;
+ width: 96px;
+ }
}

Modified: trunk/src/chrome/browser/resources/ntp4/incognito_tab.html
==============================================================================
--- trunk/src/chrome/browser/resources/ntp4/incognito_tab.html (original)
+++ trunk/src/chrome/browser/resources/ntp4/incognito_tab.html Tue Apr 29 04:23:21 2014
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title i18n-content="title"></title>
+<link rel="stylesheet" href="incognito_and_guest_tab.css">
<link rel="stylesheet" href="incognito_tab.css">
<script>
// Until themes can clear the cache, force-reload the theme stylesheet.
@@ -14,12 +15,17 @@
<body>
<div class="content"
i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
- <img src="../../../../ui/webui/resources/images/otr_icon_standalone.png" class="icon">
- <span i18n-values=".innerHTML:content"></span>
- <div class="extensions-message">
- <div class="extension-icon"></div>
- <span i18n-values=".innerHTML:extensionsmessage"></span>
- </div>
+ <div class="icon"></div>
+ <span>
+ <h1 i18n-content="incognitoTabHeading"></h1>
+ <p>
+ <span i18n-values=".innerHTML:incognitoTabDescription"></span>
+ <a i18n-content="learnMore" i18n-values=".href:learnMoreLink"></a>
+ </p>
+ <p>
+ <strong i18n-content="incognitoTabWarning"></strong>
+ </p>
+ </span>
</div>
</body>
<script src="chrome://resources/js/cr.js"></script>

Modified: trunk/src/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
==============================================================================
--- trunk/src/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc (original)
+++ trunk/src/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc Tue Apr 29 04:23:21 2014
@@ -291,14 +291,19 @@
base::DictionaryValue localized_strings;
localized_strings.SetString("title",
l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
- int new_tab_message_ids = IDS_NEW_TAB_OTR_MESSAGE;
+ int new_tab_description_ids = IDS_NEW_TAB_OTR_DESCRIPTION;
+ int new_tab_heading_ids = IDS_NEW_TAB_OTR_HEADING;
+ int new_tab_link_ids = IDS_NEW_TAB_OTR_LEARN_MORE_LINK;
+ int new_tab_warning_ids = IDS_NEW_TAB_OTR_MESSAGE_WARNING;
int new_tab_html_idr = IDR_INCOGNITO_TAB_HTML;
const char* new_tab_link = kLearnMoreIncognitoUrl;

// TODO(altimofeev): consider implementation without 'if def' usage.
#if defined(OS_CHROMEOS)
if (profile_->IsGuestSession()) {
- new_tab_message_ids = IDS_NEW_TAB_GUEST_SESSION_MESSAGE;
+ new_tab_description_ids = IDS_NEW_TAB_GUEST_SESSION_DESCRIPTION;
+ new_tab_heading_ids = IDS_NEW_TAB_GUEST_SESSION_HEADING;
+ new_tab_link_ids = IDS_NEW_TAB_GUEST_SESSION_LEARN_MORE_LINK;
new_tab_html_idr = IDR_GUEST_SESSION_TAB_HTML;
new_tab_link = kLearnMoreGuestSessionUrl;

@@ -322,13 +327,25 @@
}
#endif

- localized_strings.SetString("content",
- l10n_util::GetStringFUTF16(new_tab_message_ids,
- GetUrlWithLang(GURL(new_tab_link))));
- localized_strings.SetString("extensionsmessage",
- l10n_util::GetStringFUTF16(
- IDS_NEW_TAB_OTR_EXTENSIONS_MESSAGE,
- base::ASCIIToUTF16(chrome::kChromeUIExtensionsURL)));
+ if (profile_->IsGuestSession()) {
+ localized_strings.SetString("guestTabDescription",
+ l10n_util::GetStringUTF16(new_tab_description_ids));
+ localized_strings.SetString("guestTabHeading",
+ l10n_util::GetStringUTF16(new_tab_heading_ids));
+ } else {
+ localized_strings.SetString("incognitoTabDescription",
+ l10n_util::GetStringUTF16(new_tab_description_ids));
+ localized_strings.SetString("incognitoTabHeading",
+ l10n_util::GetStringUTF16(new_tab_heading_ids));
+ localized_strings.SetString("incognitoTabWarning",
+ l10n_util::GetStringUTF16(new_tab_warning_ids));
+ }
+
+ localized_strings.SetString("learnMore",
+ l10n_util::GetStringUTF16(new_tab_link_ids));
+ localized_strings.SetString("learnMoreLink",
+ GetUrlWithLang(GURL(new_tab_link)));
+
bool bookmark_bar_attached = profile_->GetPrefs()->GetBoolean(
prefs::kShowBookmarkBar);
localized_strings.SetBoolean("bookmarkbarattached", bookmark_bar_attached);
@@ -350,9 +367,18 @@
localized_strings.SetString("title",
l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
const char* new_tab_link = kLearnMoreGuestSessionUrl;
- localized_strings.SetString("content",
- l10n_util::GetStringFUTF16(IDS_NEW_TAB_GUEST_SESSION_MESSAGE,
- GetUrlWithLang(GURL(new_tab_link))));
+ int guest_tab_description_ids = IDS_NEW_TAB_GUEST_SESSION_DESCRIPTION;
+ int guest_tab_heading_ids = IDS_NEW_TAB_GUEST_SESSION_HEADING;
+ int guest_tab_link_ids = IDS_NEW_TAB_GUEST_SESSION_LEARN_MORE_LINK;
+
+ localized_strings.SetString("guestTabDescription",
+ l10n_util::GetStringUTF16(guest_tab_description_ids));
+ localized_strings.SetString("guestTabHeading",
+ l10n_util::GetStringUTF16(guest_tab_heading_ids));
+ localized_strings.SetString("learnMore",
+ l10n_util::GetStringUTF16(guest_tab_link_ids));
+ localized_strings.SetString("learnMoreLink",
+ GetUrlWithLang(GURL(new_tab_link)));

webui::SetFontAndTextDirection(&localized_strings);

Reply all
Reply to author
Forward
0 new messages