| Index: chrome/browser/search/search.cc
|
| diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
|
| index 645fecb9a52e535b344cc9554331c891695ddc61..c3efbe794a8450d2204a1e313f189c70a15df967 100644
|
| --- a/chrome/browser/search/search.cc
|
| +++ b/chrome/browser/search/search.cc
|
| @@ -42,6 +42,10 @@
|
| #include "chrome/browser/supervised_user/supervised_user_url_filter.h"
|
| #endif
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +#include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h"
|
| +#endif // defined(OS_CHROMEOS)
|
| +
|
| namespace search {
|
|
|
| namespace {
|
| @@ -239,6 +243,19 @@ NewTabURLState IsValidNewTabURL(Profile* profile, const GURL& new_tab_url) {
|
| return NEW_TAB_URL_VALID;
|
| }
|
|
|
| +// On Chrome OS, if the session hasn't merged yet, we need to avoid loading the
|
| +// remote NTP because that will trigger showing the merge session throttle
|
| +// interstitial page, which can show for 5+ seconds. crbug.com/591530.
|
| +bool ShouldShowLocalNewTab(const GURL& url, Profile* profile) {
|
| +#if defined(OS_CHROMEOS)
|
| + if (merge_session_throttling_utils::ShouldDelayRequestForProfile(profile) &&
|
| + merge_session_throttling_utils::ShouldDelayUrl(url)) {
|
| + return true;
|
| + }
|
| +#endif // defined(OS_CHROMEOS)
|
| + return false;
|
| +}
|
| +
|
| // Used to look up the URL to use for the New Tab page. Also tracks how we
|
| // arrived at that URL so it can be logged with UMA.
|
| struct NewTabURLDetails {
|
| @@ -259,6 +276,10 @@ struct NewTabURLDetails {
|
| GURL search_provider_url = TemplateURLRefToGURL(
|
| template_url->new_tab_url_ref(), UIThreadSearchTermsData(profile),
|
| false, false);
|
| +
|
| + if (ShouldShowLocalNewTab(search_provider_url, profile))
|
| + return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
|
| +
|
| NewTabURLState state = IsValidNewTabURL(profile, search_provider_url);
|
| switch (state) {
|
| case NEW_TAB_URL_VALID:
|
|
|