New tab source code

1,909 views
Skip to first unread message

Isiah Meadows

unread,
Feb 25, 2014, 10:16:45 PM2/25/14
to chromi...@chromium.org
I was considering reimplementing the recently closed tabs menu on the new tab page, and I was wondering where the source code concerning it actually is. I know it isn't a constantly used feature, but it is incredibly useful.

Thiago Farina

unread,
Feb 25, 2014, 10:24:46 PM2/25/14
to Isiah Meadows, Chromium-dev
On Wed, Feb 26, 2014 at 12:16 AM, Isiah Meadows <impi...@gmail.com> wrote:
I was considering reimplementing the recently closed tabs menu on the new tab page, and I was wondering where the source code concerning it actually is. I know it isn't a constantly used feature, but it is incredibly useful.

I think you will find that code in chrome/browser/ui/webui/ntp/ (C++ code) and chrome/browser/resources/ntp4/ (HTML, CSS, JS).

-- 
Thiago Farina

Peter Kasting

unread,
Feb 25, 2014, 10:32:09 PM2/25/14
to tfarina, Isiah Meadows, Chromium-dev
Or did you mean the "recently closed" code?   For that you might start with chrome/browser/ui/toolbar/recent_tabs_*.

I'm also curious about what you mean by "reimplementing".  If you were looking to restore this in Chrome proper, you'd need to involve the UI leads first -- this was moved off the NTP intentionally, as opposed to left out due to lack of time, so you probably wouldn't get approval to bring it back.  If you just wanted to implement this for your own local checkout, hopefully the above pointers are useful.  Another possibility in that latter case is that I thought we made the data here available via extension APIs now, so you could work on an extension that replaced the NTP with one containing this.  I might be wrong about that, though.

PK

Isiah Meadows

unread,
Feb 26, 2014, 11:41:24 AM2/26/14
to Peter Kasting, Thiago Farina, Chromium-dev

Ok. But on the other hand, you have a good idea of making that available through the Extension API. That would probably solve a problem pretty early, considering that is where we generally send people complaining about intentionally removed features, anyways. And @peter, you got what I meant correctly.

Matt Giuca

unread,
Feb 26, 2014, 11:13:29 PM2/26/14
to impi...@gmail.com, Peter Kasting, Thiago Farina, Chromium-dev
Just chiming in to say: this feature has not been removed, it's just been removed from the NTP. You can still access it from the hotdog menu ("Recent Tabs"). (Not sure if this was already obvious or not; it's hard to discover IMHO.)


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Vuong Nguyen

unread,
Apr 23, 2014, 12:49:06 PM4/23/14
to chromi...@chromium.org
Did you find the source code of new tab page???

Vào 10:16:45 UTC+7 Thứ tư, ngày 26 tháng hai năm 2014, Isiah Meadows đã viết:

PhistucK

unread,
Apr 23, 2014, 1:39:44 PM4/23/14
to hoangvu...@gmail.com, Chromium-dev


PhistucK


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

PhistucK

unread,
Apr 23, 2014, 1:41:24 PM4/23/14
to hoangvu...@gmail.com, Chromium-dev
No, sorry, that is the previous New Tab page. The current New Tab page is actually a remote Google page that has a local version, I believe. I will answer in the appropriate thread.


PhistucK

Vuong Nguyen

unread,
Apr 23, 2014, 9:19:40 PM4/23/14
to PhistucK, Chromium-dev

Yeh. I think new_tab.html seem does not look like new tab page structure.
Hope for your reply soon.

Vào 24-04-2014 00:42, "PhistucK" <phis...@gmail.com> đã viết:

Matt Giuca

unread,
Apr 24, 2014, 1:26:51 AM4/24/14
to Alon Gothshmidt, hoangvu...@gmail.com, Chromium-dev
I was investigating this recently, and PhistucK is correct. The HTML/JS code to the current NTP is in:
src/chrome/browser/resources/local_ntp

However, this is just the local version of the NTP, which is used if your search engine* cannot be reached, or doesn't provide its own NTP. In the default case, Google is the search engine and provides its own NTP (so in practice, you usually won't see the local_ntp at all).

I think the best thing you can do if you want to change the NTP would be to write an extension that overrides the New Tab Page, and build your own, instead of trying to modify Chrome. You may still need to modify Chrome to expose the list of recent pages to the extension, but I think that's a better approach than actually trying to change the NTP from inside Chrome.

*In practice, if your search engine is Google, you'll see Google's NTP, otherwise you'll see the local NTP. But in theory, another search engine could provide its own NTP which would be served in Chrome.

Vuong Nguyen

unread,
Apr 24, 2014, 4:39:41 AM4/24/14
to Matt Giuca, Alon Gothshmidt, Chromium-dev
Thanks for your help :)
Your answer help me a lot to understand how new tab page work. Write a extension overrides the New Tab Page of Google is a good idea.
Otherwise, May I set the Chromium always run in local_ntp ??? How to do it ?

--
Nguyễn Chí Hoàng Vương
K57CA - University of Engineering and Technology
mobile phone: 01668884617

Matt Giuca

unread,
Apr 24, 2014, 5:00:31 AM4/24/14
to Vuong Nguyen, Alon Gothshmidt, Chromium-dev
I don't think there is a setting to make Chromium always run in local_ntp (besides changing your search engine from Google). You would probably have to modify the code, by tracing through to the part where it makes the decision about whether to use local or remote NTP (which I don't know how it does).
Reply all
Reply to author
Forward
0 new messages