Commit 7446b041 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Delete dead NTP4 / chrome://apps code related to Sync promo bubble

Followup to https://crrev.com/c/1615027.

Bug: none
Change-Id: I36ecc95f484b792b79d959fdb4a8b855d44dd691
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614183
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarDan Beam <dbeam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661695}
parent 79925ea3
...@@ -180,33 +180,6 @@ html[dir='rtl'] .login-status-icon { ...@@ -180,33 +180,6 @@ html[dir='rtl'] .login-status-icon {
background-position-x: left; background-position-x: left;
} }
#login-status-bubble-contents {
font-size: 1.1em;
}
#login-status-message-container {
margin-bottom: 13px;
}
#login-status-learn-more {
display: inline-block;
}
.login-status-row {
-webkit-box-align: center;
-webkit-box-orient: horizontal;
-webkit-box-pack: end;
display: -webkit-box;
}
#login-status-advanced-container {
-webkit-box-flex: 1;
}
#login-status-dismiss {
min-width: 6em;
}
/* Trash. *********************************************************************/ /* Trash. *********************************************************************/
#trash { #trash {
......
...@@ -110,23 +110,6 @@ document.write('<link id="themecss" rel="stylesheet" ' + ...@@ -110,23 +110,6 @@ document.write('<link id="themecss" rel="stylesheet" ' +
<!-- A div to hold all the templates, and in the darkness bind them. --> <!-- A div to hold all the templates, and in the darkness bind them. -->
<div hidden> <div hidden>
<!-- Login status bubble -->
<div id="login-status-bubble-contents">
<div id="login-status-message-container">
<span>$i18n{login_status_message}</span>
<a id="login-status-learn-more" href="$i18nRaw{login_status_url}"
target="_blank">$i18n{learn_more}</a>
</div>
<div class="login-status-row">
<div id="login-status-advanced-container">
<a is="action-link" id="login-status-advanced">
$i18n{login_status_advanced}
</a>
</div>
<button id="login-status-dismiss">$i18n{login_status_dismiss}</button>
</div>
</div>
<!-- App Contents w/ Large Icon --> <!-- App Contents w/ Large Icon -->
<div id="app-large-icon-template" class="app-contents"> <div id="app-large-icon-template" class="app-contents">
<div class="app-img-container" aria-hidden="true"> <div class="app-img-container" aria-hidden="true">
......
...@@ -19,19 +19,6 @@ cr.define('ntp', function() { ...@@ -19,19 +19,6 @@ cr.define('ntp', function() {
*/ */
let newTabView; let newTabView;
/**
* If non-null, an bubble confirming that the user has signed into sync. It
* points at the login status at the top of the page.
* @type {!cr.ui.Bubble|undefined}
*/
let loginBubble;
/**
* true if |loginBubble| should be shown.
* @type {boolean}
*/
let shouldShowLoginBubble = false;
/** /**
* The time when all sections are ready. * The time when all sections are ready.
* @type {number|undefined} * @type {number|undefined}
...@@ -105,28 +92,6 @@ cr.define('ntp', function() { ...@@ -105,28 +92,6 @@ cr.define('ntp', function() {
// we can compute its layout. // we can compute its layout.
layoutFooter(); layoutFooter();
if (loadTimeData.getString('login_status_message')) {
loginBubble = new cr.ui.Bubble;
loginBubble.anchorNode = $('login-container');
loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END;
loginBubble.bubbleAlignment =
cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE;
loginBubble.deactivateToDismissDelay = 2000;
loginBubble.closeButtonVisible = false;
$('login-status-advanced').onclick = function() {
chrome.send('showAdvancedLoginUI');
};
$('login-status-dismiss').onclick = loginBubble.hide.bind(loginBubble);
const bubbleContent = $('login-status-bubble-contents');
loginBubble.content = bubbleContent;
// The anchor node won't be updated until updateLogin is called so don't
// show the bubble yet.
shouldShowLoginBubble = true;
}
$('login-container').addEventListener('click', showSyncLoginUI); $('login-container').addEventListener('click', showSyncLoginUI);
if (loadTimeData.getBoolean('shouldShowSyncLogin')) { if (loadTimeData.getBoolean('shouldShowSyncLogin')) {
chrome.send('initializeSyncLogin'); chrome.send('initializeSyncLogin');
...@@ -295,14 +260,6 @@ cr.define('ntp', function() { ...@@ -295,14 +260,6 @@ cr.define('ntp', function() {
headerContainer.style.backgroundImage = headerContainer.style.backgroundImage =
iconURL ? getUrlForCss(iconURL) : 'none'; iconURL ? getUrlForCss(iconURL) : 'none';
} }
if (shouldShowLoginBubble) {
window.setTimeout(loginBubble.show.bind(loginBubble), 0);
chrome.send('loginMessageSeen');
shouldShowLoginBubble = false;
} else if (loginBubble) {
loginBubble.reposition();
}
} }
/** /**
...@@ -362,14 +319,6 @@ cr.define('ntp', function() { ...@@ -362,14 +319,6 @@ cr.define('ntp', function() {
newTabView.appsPrefChangedCallback(data); newTabView.appsPrefChangedCallback(data);
} }
/**
* Callback invoked by chrome whenever the app launcher promo pref changes.
* @param {boolean} show Identifies if we should show or hide the promo.
*/
function appLauncherPromoPrefChangeCallback(show) {
newTabView.appLauncherPromoPrefChangeCallback(show);
}
/** /**
* Called whenever tiles should be re-arranging themselves out of the way * Called whenever tiles should be re-arranging themselves out of the way
* of a moving or insert tile. * of a moving or insert tile.
...@@ -431,7 +380,6 @@ cr.define('ntp', function() { ...@@ -431,7 +380,6 @@ cr.define('ntp', function() {
appMoved: appMoved, appMoved: appMoved,
appRemoved: appRemoved, appRemoved: appRemoved,
appsPrefChangeCallback: appsPrefChangeCallback, appsPrefChangeCallback: appsPrefChangeCallback,
appLauncherPromoPrefChangeCallback: appLauncherPromoPrefChangeCallback,
enterRearrangeMode: enterRearrangeMode, enterRearrangeMode: enterRearrangeMode,
getAppsCallback: getAppsCallback, getAppsCallback: getAppsCallback,
getAppsPageIndex: getAppsPageIndex, getAppsPageIndex: getAppsPageIndex,
......
...@@ -18,12 +18,10 @@ ...@@ -18,12 +18,10 @@
#include "chrome/browser/profiles/profile_attributes_entry.h" #include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h" #include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_promo_util.h" #include "chrome/browser/signin/signin_promo_util.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/webui/profile_info_watcher.h" #include "chrome/browser/ui/webui/profile_info_watcher.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
...@@ -33,10 +31,8 @@ ...@@ -33,10 +31,8 @@
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/signin/core/browser/signin_metrics.h" #include "components/signin/core/browser/signin_metrics.h"
#include "components/signin/core/browser/signin_pref_names.h" #include "components/signin/core/browser/signin_pref_names.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "content/public/common/page_zoom.h"
#include "net/base/escape.h" #include "net/base/escape.h"
#include "services/identity/public/cpp/identity_manager.h" #include "services/identity/public/cpp/identity_manager.h"
#include "skia/ext/image_operations.h" #include "skia/ext/image_operations.h"
...@@ -98,15 +94,7 @@ void AppLauncherLoginHandler::RegisterMessages() { ...@@ -98,15 +94,7 @@ void AppLauncherLoginHandler::RegisterMessages() {
"showSyncLoginUI", "showSyncLoginUI",
base::BindRepeating(&AppLauncherLoginHandler::HandleShowSyncLoginUI, base::BindRepeating(&AppLauncherLoginHandler::HandleShowSyncLoginUI,
base::Unretained(this))); base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"showAdvancedLoginUI",
base::BindRepeating(&AppLauncherLoginHandler::HandleShowAdvancedLoginUI,
base::Unretained(this)));
#endif #endif
web_ui()->RegisterMessageCallback(
"loginMessageSeen",
base::BindRepeating(&AppLauncherLoginHandler::HandleLoginMessageSeen,
base::Unretained(this)));
} }
void AppLauncherLoginHandler::HandleInitializeSyncLogin( void AppLauncherLoginHandler::HandleInitializeSyncLogin(
...@@ -149,24 +137,6 @@ void AppLauncherLoginHandler::RecordInHistogram(NTPSignInPromoBuckets type) { ...@@ -149,24 +137,6 @@ void AppLauncherLoginHandler::RecordInHistogram(NTPSignInPromoBuckets type) {
NTP_SIGN_IN_PROMO_BUCKET_BOUNDARY); NTP_SIGN_IN_PROMO_BUCKET_BOUNDARY);
} }
void AppLauncherLoginHandler::HandleLoginMessageSeen(
const base::ListValue* args) {}
#if !defined(OS_CHROMEOS)
void AppLauncherLoginHandler::HandleShowAdvancedLoginUI(
const base::ListValue* args) {
content::WebContents* web_contents = web_ui()->GetWebContents();
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
if (!browser)
return;
signin_metrics::AccessPoint access_point =
web_contents->GetURL().spec() == chrome::kChromeUIAppsURL
? signin_metrics::AccessPoint::ACCESS_POINT_APPS_PAGE_LINK
: signin_metrics::AccessPoint::ACCESS_POINT_NTP_LINK;
chrome::ShowBrowserSignin(browser, access_point);
}
#endif
void AppLauncherLoginHandler::UpdateLogin() { void AppLauncherLoginHandler::UpdateLogin() {
std::string username = profile_info_watcher_->GetAuthenticatedUsername(); std::string username = profile_info_watcher_->GetAuthenticatedUsername();
base::string16 header, sub_header; base::string16 header, sub_header;
...@@ -242,12 +212,3 @@ bool AppLauncherLoginHandler::ShouldShow(Profile* profile) { ...@@ -242,12 +212,3 @@ bool AppLauncherLoginHandler::ShouldShow(Profile* profile) {
return !profile->IsOffTheRecord() && is_signin_allowed; return !profile->IsOffTheRecord() && is_signin_allowed;
#endif #endif
} }
// static
void AppLauncherLoginHandler::GetLocalizedValues(
Profile* profile, base::DictionaryValue* values) {
values->SetString("login_status_message", base::string16());
values->SetString("login_status_url", std::string());
values->SetString("login_status_advanced", base::string16());
values->SetString("login_status_dismiss", base::string16());
}
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
class Profile; class Profile;
class ProfileInfoWatcher; class ProfileInfoWatcher;
namespace base {
class DictionaryValue;
}
// The login handler currently simply displays the current logged in // The login handler currently simply displays the current logged in
// username at the top of the NTP (and update itself when that changes). // username at the top of the NTP (and update itself when that changes).
// In the future it may expand to allow users to login from the NTP. // In the future it may expand to allow users to login from the NTP.
...@@ -33,10 +29,6 @@ class AppLauncherLoginHandler : public content::WebUIMessageHandler { ...@@ -33,10 +29,6 @@ class AppLauncherLoginHandler : public content::WebUIMessageHandler {
// for the given |profile|. |profile| must not be NULL. // for the given |profile|. |profile| must not be NULL.
static bool ShouldShow(Profile* profile); static bool ShouldShow(Profile* profile);
// Registers values (strings etc.) for the page.
static void GetLocalizedValues(Profile* profile,
base::DictionaryValue* values);
private: private:
// User actions while on the NTP when clicking on or viewing the sync promo. // User actions while on the NTP when clicking on or viewing the sync promo.
enum NTPSignInPromoBuckets { enum NTPSignInPromoBuckets {
...@@ -54,20 +46,11 @@ class AppLauncherLoginHandler : public content::WebUIMessageHandler { ...@@ -54,20 +46,11 @@ class AppLauncherLoginHandler : public content::WebUIMessageHandler {
// appropriate UI based on the current sync state. |args| is the list of // appropriate UI based on the current sync state. |args| is the list of
// arguments passed from JS and should be an empty list. // arguments passed from JS and should be an empty list.
void HandleShowSyncLoginUI(const base::ListValue* args); void HandleShowSyncLoginUI(const base::ListValue* args);
// Called from JS when the user clicks on the advanced link the sync promo NTP
// bubble. Use use this to navigate to the sync settings page. |args| is the
// list of arguments passed from JS and should be an empty list.
void HandleShowAdvancedLoginUI(const base::ListValue* args);
#endif #endif
// Records actions in SyncPromo.NTPPromo histogram. // Records actions in SyncPromo.NTPPromo histogram.
void RecordInHistogram(NTPSignInPromoBuckets type); void RecordInHistogram(NTPSignInPromoBuckets type);
// Called from JS when the sync promo NTP bubble has been displayed. |args| is
// the list of arguments passed from JS and should be an empty list.
void HandleLoginMessageSeen(const base::ListValue* args);
// Internal helper method // Internal helper method
void UpdateLogin(); void UpdateLogin();
......
...@@ -456,7 +456,6 @@ void NTPResourceCache::CreateNewTabHTML() { ...@@ -456,7 +456,6 @@ void NTPResourceCache::CreateNewTabHTML() {
CanShowAppInfoDialog()); CanShowAppInfoDialog());
AppLauncherHandler::GetLocalizedValues(profile_, &load_time_data); AppLauncherHandler::GetLocalizedValues(profile_, &load_time_data);
AppLauncherLoginHandler::GetLocalizedValues(profile_, &load_time_data);
webui::SetLoadTimeDataDefaults(app_locale, &load_time_data); webui::SetLoadTimeDataDefaults(app_locale, &load_time_data);
......
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