Commit 63e8b251 authored by Huanzhong Huang's avatar Huanzhong Huang Committed by Commit Bot

Cookie controls notice on incognito ntp

Show cookie controls notice on incognito ntp when
the improvedCookieControls flag is enabled.

screenshot: https://screenshot.googleplex.com/WTCUPwSowr9

Bug: 967668
Change-Id: I83b0d6c607ccd4a339ea66b829405224bfbc1732
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814817Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarDan Beam <dbeam@chromium.org>
Reviewed-by: default avatarChristian Dullweber <dullweber@chromium.org>
Commit-Queue: Huanzhong Huang <huanzhong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700290}
parent 18490edd
...@@ -96,6 +96,13 @@ em { ...@@ -96,6 +96,13 @@ em {
} }
} }
/** Third-Party Cookie Blocking Box ----------------------------------------- */
#cookie-controls {
background-color: rgb(60, 64, 67); /* --google-grey-800 */
box-sizing: border-box;
}
/** Layout ------------------------------------------------------------------ */ /** Layout ------------------------------------------------------------------ */
/* Align the content, icon, and title to to the center. */ /* Align the content, icon, and title to to the center. */
...@@ -155,6 +162,15 @@ h1 { ...@@ -155,6 +162,15 @@ h1 {
padding-inline-start: 16px; padding-inline-start: 16px;
} }
#cookie-controls {
margin-bottom: 1.5rem;
padding: 1.5rem;
}
#cookie-controls-description {
margin-top: 0.5rem;
}
/* Wide screens. */ /* Wide screens. */
@media (min-width: 720px) { @media (min-width: 720px) {
.icon, .icon,
......
...@@ -30,6 +30,14 @@ document.write('<link id="incognitothemecss" rel="stylesheet" ' + ...@@ -30,6 +30,14 @@ document.write('<link id="incognitothemecss" rel="stylesheet" ' +
<div class="bulletpoints first">$i18nRaw{incognitoTabFeatures}</div> <div class="bulletpoints first">$i18nRaw{incognitoTabFeatures}</div>
<div class="bulletpoints">$i18nRaw{incognitoTabWarning}</div> <div class="bulletpoints">$i18nRaw{incognitoTabWarning}</div>
</div> </div>
<div id="cookie-controls" $i18n{hiddenIfCookieControlsDisabled}>
<div>
<em>$i18n{cookieControlsTitle}</em>
</div>
<div id="cookie-controls-description">
$i18n{cookieControlsDescription}
</div>
</div>
<a class="learn-more-button" href="$i18n{learnMoreLink}">$i18n{learnMore}</a> <a class="learn-more-button" href="$i18n{learnMoreLink}">$i18n{learnMore}</a>
</div> </div>
<script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/cr.js"></script>
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h" #include "chrome/grit/theme_resources.h"
#include "components/bookmarks/common/bookmark_pref_names.h" #include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/content_settings/core/common/features.h"
#include "components/google/core/common/google_util.h" #include "components/google/core/common/google_util.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/identity_manager.h"
...@@ -274,6 +275,14 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() { ...@@ -274,6 +275,14 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() {
l10n_util::GetStringUTF8(IDS_NEW_TAB_OTR_NOT_SAVED); l10n_util::GetStringUTF8(IDS_NEW_TAB_OTR_NOT_SAVED);
replacements["learnMoreLink"] = kLearnMoreIncognitoUrl; replacements["learnMoreLink"] = kLearnMoreIncognitoUrl;
replacements["title"] = l10n_util::GetStringUTF8(IDS_NEW_TAB_TITLE); replacements["title"] = l10n_util::GetStringUTF8(IDS_NEW_TAB_TITLE);
replacements["hiddenIfCookieControlsDisabled"] =
base::FeatureList::IsEnabled(content_settings::kImprovedCookieControls)
? ""
: "hidden";
replacements["cookieControlsTitle"] =
l10n_util::GetStringUTF8(IDS_SETTINGS_SITE_SETTINGS_THIRD_PARTY_COOKIE);
replacements["cookieControlsDescription"] =
l10n_util::GetStringUTF8(IDS_NEW_TAB_OTR_COOKIE_CONTROLS_DESCRIPTION);
const ui::ThemeProvider& tp = const ui::ThemeProvider& tp =
ThemeService::GetThemeProviderForProfile(profile_); ThemeService::GetThemeProviderForProfile(profile_);
......
...@@ -160,5 +160,8 @@ ...@@ -160,5 +160,8 @@
<ph name="LIST_ITEM">&lt;li&gt;</ph>Your internet service provider <ph name="LIST_ITEM">&lt;li&gt;</ph>Your internet service provider
<ph name="END_LIST">&lt;/ul&gt;</ph> <ph name="END_LIST">&lt;/ul&gt;</ph>
</message> </message>
<message name="IDS_NEW_TAB_OTR_COOKIE_CONTROLS_DESCRIPTION" desc="Description of the cookie controls box shown in the incognito ntp.">
When turned on, sites can’t use cookies that track you across the web
</message>
</grit-part> </grit-part>
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