Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Issue 434046: Support for chrome.experimental.popup API in ExternalTabContainer views (Closed)

Created:
11 years ago by Jeff Timanus
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, ben+cc_chromium.org, Erik does not do reviews, jam, Aaron Boodman, pam+watch_chromium.org, darin (slow to review), brettw at google
Visibility:
Public.

Description

A collection of fixes allowing the chrome.experimental.popup.* set of APIs to function in circumstances where there is no Browser instance present. This is a symptom of a tab-contents view hosted in an ExternalTabContainer.The major change here is the removal of the explicit dependency on a Browser instance across all of the delegates involved when showing a pop-up API. I modified the following delegates:- ExtensionPopupHost::Delegate- TabContentsDelegate- ExtensionFunctionDispatcher::DelegateBecause the pop-up requires a Profile, and a gfx::NativeWindow, I added methods to the above interfaces to provide them.BUG=noneTEST=ExtensionApiTest.FLAKY_Popup Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34219

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 30

Patch Set 12 : '' #

Patch Set 13 : '' #

Total comments: 23

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+232 lines, -44 lines) Patch
M chrome/browser/browser.h View 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/dom_ui/dom_ui.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_dom_ui.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_dom_ui.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +25 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_function_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_function_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +20 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +10 lines, -7 lines 0 comments Download
M chrome/browser/extensions/extension_popup_api.cc View 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_popup_apitest.cc View 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_popup_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_popup_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +27 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_process_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/external_tab_container.h View 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/external_tab_container.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_delegate.h View 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -0 lines 3 comments Download
M chrome/browser/views/browser_actions_container.cc View 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/views/browser_bubble.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +22 lines, -8 lines 0 comments Download
M chrome/browser/views/extensions/extension_popup.h View 2 3 4 5 6 7 8 9 10 11 12 4 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/views/extensions/extension_popup.cc View 2 3 4 5 6 7 8 9 10 11 12 4 chunks +22 lines, -8 lines 0 comments Download
M chrome/browser/views/location_bar_view.cc View 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +14 lines, -3 lines 0 comments Download
M views/widget/widget_win.cc View 11 12 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 22 (0 generated)
Jeff Timanus
Hi Guys, Please take a moment to review this change. I have managed to get ...
11 years ago (2009-11-25 02:11:26 UTC) #1
Jeff Timanus
Hi Guys, Once the return-from-vacation frenzy settles down, could you please take a moment to ...
11 years ago (2009-11-30 17:02:15 UTC) #2
Erik does not do reviews
Sorry for the delay getting back to you on this. I had started to do ...
11 years ago (2009-12-01 20:48:26 UTC) #3
twiz
Thanks, Erik. I'll look into making use of a NativeWindow (which is just a typedef ...
11 years ago (2009-12-01 22:34:34 UTC) #4
Jeff Timanus
Erik, I made the change you suggested. All of the delegates that I modified now ...
11 years ago (2009-12-04 03:27:23 UTC) #5
Erik does not do reviews
Again, sorry for continuing to be slow here. Expect continued slow response for another week ...
11 years ago (2009-12-05 21:08:23 UTC) #6
Jeff Timanus
Thanks for your review, Erik. I added a bug for the browser_id issue discussed in ...
11 years ago (2009-12-08 01:02:49 UTC) #7
Jeff Timanus
Hi Evan & Peter, Evan, could you please review this CL as soon as possible? ...
11 years ago (2009-12-09 19:13:09 UTC) #8
Evan Stade
overall lg to me, but please wait for Peter's comments http://codereview.chromium.org/434046/diff/14004/18012 File chrome/browser/extensions/extension_dom_ui.cc (right): http://codereview.chromium.org/434046/diff/14004/18012#newcode86 ...
11 years ago (2009-12-09 19:35:36 UTC) #9
Jeff Timanus
I addressed your remarks, please look again. Peter, your comments are not showing up in ...
11 years ago (2009-12-09 20:44:37 UTC) #10
Peter Kasting
(These were already sent by email and addressed, I'm trying to get Rietveld to note ...
11 years ago (2009-12-09 20:50:31 UTC) #11
Peter Kasting
On 2009/12/09 20:44:37, Jeff Timanus wrote: > http://codereview.chromium.org/434046/diff/14004/18009#newcode24 > chrome/browser/views/browser_bubble.cc:24: > In response to: mailto:pkasting@chromium.org ...
11 years ago (2009-12-09 20:54:59 UTC) #12
Jeff Timanus
On 2009/12/09 20:54:59, Peter Kasting wrote: > On 2009/12/09 20:44:37, Jeff Timanus wrote: > > ...
11 years ago (2009-12-09 21:09:22 UTC) #13
Jeff Timanus
http://codereview.chromium.org/434046/diff/14004/18006 File chrome/browser/extensions/extension_host.cc (right): http://codereview.chromium.org/434046/diff/14004/18006#newcode606 chrome/browser/extensions/extension_host.cc:606: Browser* browser = const_cast<ExtensionHost* >(this)->GetBrowser(); On 2009/12/09 20:44:37, Jeff ...
11 years ago (2009-12-09 21:16:22 UTC) #14
Evan Stade
> Does Chrome have a standard wrt transitive const? I made the change you > ...
11 years ago (2009-12-09 21:26:01 UTC) #15
Evan Stade
http://codereview.chromium.org/434046/diff/14004/18002 File chrome/browser/extensions/extension_process_manager.cc (right): http://codereview.chromium.org/434046/diff/14004/18002#newcode52 chrome/browser/extensions/extension_process_manager.cc:52: CloseBackgroundHosts(); On 2009/12/09 20:44:37, Jeff Timanus wrote: > On ...
11 years ago (2009-12-09 21:26:10 UTC) #16
Peter Kasting
On 2009/12/09 21:16:22, Jeff Timanus wrote: > Does Chrome have a standard wrt transitive const? ...
11 years ago (2009-12-09 21:34:42 UTC) #17
Evan Stade
lgtm
11 years ago (2009-12-09 21:53:06 UTC) #18
Ben Goodger (Google)
Hi Jeff, I know this code review is ancient but I just discovered the presence ...
10 years, 6 months ago (2010-06-03 23:21:17 UTC) #19
Jeff Timanus
Hi Ben, Yes, there is some ugly complexity in the implementation of the experimental extension ...
10 years, 6 months ago (2010-06-04 18:16:15 UTC) #20
Ben Goodger (Google)
Jeff, What's the status on this? It's now been over a month. -Ben On Mon, ...
10 years, 5 months ago (2010-07-07 18:56:39 UTC) #21
twiz
10 years, 5 months ago (2010-07-07 19:22:30 UTC) #22
Hi Ben,

Unfortunately, I've been distracted with other important Chrome-Frame issues
for the past while - specifically getting host networking support for
document.cookie requests.  That task is wrapping up, and next on my list was
to correct the design of the popup internals.

Jeff

On Wed, Jul 7, 2010 at 2:56 PM, Ben Goodger (Google) <ben@chromium.org>wrote:

> Jeff,
>
> What's the status on this? It's now been over a month.
>
> -Ben
>
> On Mon, Jun 14, 2010 at 2:40 PM, Ben Goodger (Google) <ben@chromium.org>
> wrote:
> > OK. You should work with the other extensions folk to fix this then asap.
> >
> > -Ben
> >
> > On Fri, Jun 4, 2010 at 11:16 AM,  <twiz@chromium.org> wrote:
> >> Hi Ben,
> >>
> >> Yes, there is some ugly complexity in the implementation of the
> experimental
> >> extension popup API.  A lot of this is a result of the need to display
> >> popups in
> >> ExtensionHosts, and ExtensionDOMUI views.  (And in Chrome-Frame
> extension
> >> views
> >> as well.)
> >>
> >> Please see my response below.
> >>
> >> Jeff
> >>
> >>
> >> http://codereview.chromium.org/434046/diff/26025/27020
> >> File chrome/browser/tab_contents/tab_contents_delegate.h (right):
> >>
> >> http://codereview.chromium.org/434046/diff/26025/27020#newcode256
> >> chrome/browser/tab_contents/tab_contents_delegate.h:256: virtual
> >> Browser* GetBrowser() { return NULL; }
> >> On 2010/06/03 23:21:18, Ben Goodger wrote:
> >>>
> >>> This is a layering violation and is just about the worst thing you can
> >>
> >> do in
> >>>
> >>> Chrome code short of shooting a kitten.
> >>
> >> Yikes!  And I love kittens!  (We should be able to resolve this issue -
> >> some changes will be needed in the ExtensionPopup::Show and associated
> >> routines.)
> >>
> >>
> >>> We need to correct this since it looks like people (e.g. dhg@) are
> >>
> >> already
> >>>
> >>> beginning to use this for other purposes.
> >>
> >>> TabContents should never rely on Browser, it is at a lower level of
> >>
> >> abstraction.
> >>
> >> I added this method because of the need for these parameters during
> >> display of an ExtensionPopup view.  (See
> >> browser\views\extensions\extension_popup.{h|cc})  The experimental
> >> extension popup API only has access to an ExtensionFunctionDispatcher,
> >> and needed a means to gain access to these values.  See
> >> browser\extensions\extension_pop_api.cc.
> >>
> >> The TabContentsDelegate is used to implement the
> >> ExtensionFunctionDispatcher::Delegate interface in both ExtensionDOMUI,
> >> and ExtensionHost.  This is because popups can be launched both from
> >> ExtensionHosts (toolstrips), or from a TabContents view that has been
> >> navigated to an extension url.
> >>
> >> Looking at the use of the Browser in the construction of the
> >> ExtensionPopup, it seems to be required during the construction of the
> >> ExtensionHost for use within the popup.  See
> >> ExtensionProcessManager::CreateView.  Perhaps it would be possible to
> >> decouple these functions from the browser, but further inspection will
> >> be required.
> >>
> >> The native window that frames the view that is launching the popup is
> >> used to find the corresponding widget.  This is subsequently used during
> >> positioning of the popup (which is a top-level window).  The widget is
> >> used to convert the coordinates of the position of the popup, which are
> >> in the coordinate frame of the frame to coordinates on the screen.
> >>
> >> I hope that makes some sense.  Please let me know if you need more
> >> clarification.  I was not aware, at the time, of the abstraction
> >> boundary between the TabContentsDelegate and Browser classes.
> >>
> >> I'll investigate if there is a means to have the
> >> ExtensionFunctionDispatcher (which I presume can know all about the
> >> Browser) provide a different access point for the browser and framing
> >> window.
> >>
> >> http://codereview.chromium.org/434046/show
> >>
> >
>



-- 
Software Developer
Google Canada
(514) 670-8756

Powered by Google App Engine
This is Rietveld 408576698