On Tue, Sep 15, 2009 at 9:21 PM, Mohamed Mansour <m...@chromium.org> wrote: > The UI is going to be in JavaScript with callbacks from the DOMUI page same > as NTP, Downloads, History, etc... Therefore in render_view.cc, I need to > replace the WebFrame with the DOMUI (I think). I don't want to introduce my > own set of methods that exposes this, that is why I am asking for some > thoughts, on the right approach.
There are many layers here, and you have to be careful you're at the right one. Because we wanted to prevent mistakes allowing web content access to privileged browser data (unless something's changed since I last worked on it) you have to use an entirely new renderering process for DOMUI. WebFrame is down within a given renderer, while DOMUI is a browser-level abstraction above the IPC layer. You can have a DOMUI within the same tab, of course (that's how you can click links from the new tab page). If you really want to show the original page, you'll have to do something either tricky or sneaky. M-A's idea is good. Another idea is to add more goop at the UI level to allow a tab to display a DOMUI "toolbar" (with the print button etc.) while still showing the original page below the toolbar. Like a frame, but done at a higher level so the page can't bust out of its frame. If instead you just want to display an image of the page, previewed, that's easier. Grab the snapshot when navigating away to your DOMUI; don't even tell the page you've navigated away (avoids all the "do you want to save?" dialogs etc.) and swap its renderer out entirely. To get the snapshot back in to your new DOMUI, the rest of what Tim wrote (aside from the part I just contradicted in the last sentence) about how to get images in is right. The way we load thumbnails into the NTP is a good resource; basically the page would have something like <img src='whatever-the-internal-scheme-is://preview'> and you'd hook up a data handler to serve the image data on that URL. You might run into some jankiness because of the way images are currently served (just as one huge string rather than incrementally loaded) but that is an optimization detail that can be worked on after you have it kinda working. --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---