• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

background/H16-Feb-2021-1,5041,060

chrome_colors/H16-Feb-2021-425278

one_google_bar/H16-Feb-2021-1,5411,088

promos/H16-Feb-2021-1,000693

repeatable_queries/H16-Feb-2021-10373

search_suggest/H03-May-2022-2,0491,433

suggestions/H16-Feb-2021-239157

task_module/H16-Feb-2021-1,078900

tools/H16-Feb-2021-6039

BUILD.gnH A D16-Feb-20211.4 KiB4739

OWNERSH A D16-Feb-2021135 74

README.mdH A D16-Feb-20215.5 KiB151108

contextual_search_policy_handler_android.ccH A D16-Feb-20211.6 KiB4125

contextual_search_policy_handler_android.hH A D16-Feb-20211 KiB3318

contextual_search_policy_handler_android_unittest.ccH A D16-Feb-20212 KiB5642

instant_service.ccH A D16-Feb-202140.8 KiB1,069866

instant_service.hH A D16-Feb-202112.7 KiB348180

instant_service_factory.ccH A D16-Feb-20211.9 KiB5237

instant_service_factory.hH A D16-Feb-20211.4 KiB4426

instant_service_observer.ccH A D16-Feb-2021384 114

instant_service_observer.hH A D16-Feb-2021950 3317

instant_service_unittest.ccH A D16-Feb-202133.6 KiB824636

instant_unittest_base.ccH A D16-Feb-20212.6 KiB7556

instant_unittest_base.hH A D16-Feb-20211.5 KiB4422

local_ntp_navigation_browsertest.ccH A D16-Feb-20215.4 KiB12787

local_ntp_source.ccH A D16-Feb-202157.2 KiB1,4411,198

local_ntp_source.hH A D16-Feb-20216.6 KiB177109

most_visited_iframe_source.ccH A D16-Feb-20218.2 KiB207173

most_visited_iframe_source.hH A D16-Feb-20212.3 KiB6136

most_visited_iframe_source_unittest.ccH A D16-Feb-20215.9 KiB169135

ntp_custom_background_enabled_policy_handler.ccH A D16-Feb-20211.2 KiB3223

ntp_custom_background_enabled_policy_handler.hH A D16-Feb-20211.2 KiB3520

ntp_custom_background_enabled_policy_handler_browsertest.ccH A D16-Feb-20213 KiB7150

ntp_features_unittest.ccH A D16-Feb-20213 KiB8256

ntp_icon_source.ccH A D16-Feb-202116.5 KiB436344

ntp_icon_source.hH A D16-Feb-20212.6 KiB7651

search.ccH A D16-Feb-202113.2 KiB405291

search.hH A D16-Feb-20213.2 KiB9131

search_engine_base_url_tracker.ccH A D16-Feb-20212.9 KiB7550

search_engine_base_url_tracker.hH A D16-Feb-20212.2 KiB6337

search_engine_base_url_tracker_unittest.ccH A D16-Feb-20211,020 2717

search_unittest.ccH A D16-Feb-202119.5 KiB455375

README.md

1New Tab Page (Desktop)
2======================
3
4On Desktop (ChromeOS, Windows, Mac, and Linux), there are multiple
5variants of the **New Tab Page** (**NTP**). The variant is selected
6according to the user’s **Default Search Engine** (**DSE**). All
7variants are implemented as HTML/CSS/JS, but differ in where they are
8hosted.
9
10*   **Google**: The **[Local NTP][local-ntp]**, with Google branding.
11
12*   **Bing**, **Yandex**: a **[Third-Party NTP][third-party-ntp]**,
13    where the NTP is hosted on third-party servers but Chrome provides
14    some of the content via <iframe> elements.
15
16*   **Other**: the **Local NTP** with no branding.
17
18As of 2017-12-05, Bing and Yandex have implemented third-party NTPs. The
19full list is in [`prepopulated_engines.json`][engines], under the key
20`"new_tab_url"`.
21
22Non-Google variants show up to 8 **NTP Tiles**. Each NTP tile represents a site
23that Chrome believes the user is likely to want to visit. On Desktop, NTP tiles
24have a title, a large icon, and an “X” button so that the user can remove tiles
25that they don’t want.
26
27Google variants show up to 10 **NTP Tiles** (now called shortcuts) and give
28users the ability to customize them. This includes adding new shortcuts using
29the "Add shortcut" button, deleting/editing shortcuts from the three-dot "Edit
30shortcut" menu (replaces the "X" button), and reordering via click-and-drag.
31
32[local-ntp]:        #local-ntp
33[third-party-ntp]:  #third_party-ntp
34[engines]:          https://chromium.googlesource.com/chromium/src/+/master/components/search_engines/prepopulated_engines.json
35
36Variants
37--------
38
39### Local NTP
40
41#### Google branding
42
43##### One Google Bar
44
45The **One Google Bar** (**OGB**) is at the top of the NTP. The NTP
46fetches the OGB from Google servers each time it loads.
47
48##### Google Logo
49
50The **Google Logo** is below the OGB. By default, it is the regular
51Google logo. It can also be a **Doodle**, if a Google Doodle is running
52for a particular combination of (today’s date, user’s country, user’s
53birthday).
54
55###### No Doodle
56
57On a day when there is no Doodle (in the user’s current country), the
58NTP shows the Google logo. It comes in two variants:
59
60*   Colorful, if the user is using the default theme, or on any other
61    theme with a solid black (L=0%), white (L=100%), or gray (S=0%)
62    background color.
63*   White, if the user’s theme has a background image, or if the
64    background is a solid color, but not black, white, or gray.
65
66Also, even on days when there is a Doodle, if the user’s theme’s
67background is not solid white, new NTPs show the Google logo by default.
68In this case, an animated spinner advertises the Doodle. If the user
69clicks on the spinner, then the NTP resets to the default theme and
70shows the Doodle.
71
72###### Static Doodles
73
74A **Static Doodle** shows as a single static image. When clicked, it
75triggers a navigation to the Doodle’s target URL.
76
77###### Animated Doodles
78
79An **Animated Doodle** initially shows a static **Call-to-Action**
80(**CTA**) image, usually with a “play” icon. When clicked, it swaps out
81the CTA image for an animated image. When clicked a second time, it
82triggers a navigation to the Doodle’s target URL.
83
84###### Interactive Doodles
85
86An **Interactive Doodle** is embedded into the NTP as an `<iframe>`.
87The framed content usually contains a CTA image, but this is opaque to
88the containing NTP.
89
90The embedded Doodle can ask the containing NTP to resize the `<iframe>`
91tag to enlarge the space available for the Doodle. To do this, it sends
92a `postMessage()` call to `window.parent`. The event data supports these
93parameters:
94
95*   `cmd` (required string): must be `"resizeDoodle"`.
96*   `width` (required string): a CSS width (with units). Because the
97    Doodle cannot know the size of the outer page, values based on
98    `"100%"` (e.g. `"100%"` or `"calc(100% - 50px)"`) are recommended.
99*   `height` (required string): a CSS height (with units). Must not be a
100    percentage, but otherwise any units are OK.
101*   `duration` (optional string): a CSS duration, such as `"130ms"` or
102    `"1s"`. If `null` or absent, `"0s"` (no transition) is assumed.
103
104For example:
105
106    // Reset to initial width and height.
107    window.parent.postMessage({cmd: "resizeDoodle"});
108
109    // Transition smoothly to full-width, 350px tall.
110    window.parent.postMessage({
111        cmd: "resizeDoodle",
112        width: "100%",
113        height: "350px",
114        duration: "1s",
115    });
116
117##### Fakebox
118
119The **Fakebox** looks like a search bar, so that the NTP mimics the
120appearance of the Google homepage. It’s not actually a real search bar,
121and if the user interacts with it, the NTP moves keyboard focus and any
122text to the Omnibox and hides the Fakebox.
123
124##### Search Suggestions
125
126Above the NTP tiles there is space for search suggestions. Search suggestions
127are typically 3-4 queries recommended to logged-in users based on their previous
128search history.
129
130Search suggestions are fetched from Google servers on NTP load and cached to be
131displayed on the following NTP load.
132
133##### Middle-slot Promos
134
135Below the NTP tiles, there is space for a **Middle-slot Promo**. A promo is
136typically a short string, typically used for disasters (e.g. “Affected
137by the Boston Molassacre? Find a relief center near you.”) or an
138advertisement (e.g. “Try the all-new new Chromebook, with included
139toaster oven.”).
140
141Middle-slot promos are fetched from Google servers on NTP load.
142
143#### Non-Google Local NTP
144
145A non-Google local NTP shows only NTP tiles, with no branding. The tiles
146are centered within the page.
147
148### Third-Party NTP
149
150TODO(sfiera)
151