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

Issue 1280673003: [Mac] Enable MacViews site settings bubble behind --enable-mac-views-dialogs. (Closed)

Created:
5 years, 4 months ago by jackhou1
Modified:
5 years, 3 months ago
Reviewers:
tapted, msw
CC:
chromium-reviews, tfarina, markusheintz_, raymes+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@enabledialogs
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Enable MacViews site settings bubble behind --enable-mac-views-dialogs. This allows BrowserWindowCocoa to show the Views WebsiteSettingsPopup. BubbleDelegateView expects a views::View to anchor the bubble, but on Mac there is only an anchor point. Add WebsiteSettingsPopupView::ShowPopupAtRect() and pass a zero-size rect located at the anchor point. This works for bubbles that close as soon as they lose focus. In the long term the anchor will need to be a Widget to support bubbles that can stay open. Don't mirror the bubble position if it is partially offscreen. This is consistent with Cocoa behavior, and avoids the bubble overlapping the icon since the Cocoa anchor point is always below the icon. This will also use the Views CollectedCookies dialog if opened from WebsiteSettingsPopupView. Estimated framework size increase (based at r343614): Before: 108,068,520 After: 108,171,776 Delta: 103,256 (0.1%) While there's little additional code, the size increase is attributable to additional parts of toolkit-views being used which can no longer be culled at link time. BUG=511051 Committed: https://crrev.com/700bafd0eba1167c3313739142e26dc10a46cd09 Cr-Commit-Position: refs/heads/master@{#343823}

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address comments. #

Patch Set 3 : Fix compile. #

Patch Set 4 : Sync #

Total comments: 34

Patch Set 5 : Address comments. #

Total comments: 5

Patch Set 6 : Address comments. #

Patch Set 7 : Sync #

Total comments: 6

Patch Set 8 : Address comments. #

Patch Set 9 : Nits. #

Total comments: 5

Patch Set 10 : Address comments. #

Total comments: 6

Patch Set 11 : Address comments. #

Patch Set 12 : Missed a comment. #

Total comments: 13

Patch Set 13 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -43 lines) Patch
M chrome/browser/ui/browser_dialogs.h View 1 4 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm View 1 2 3 4 5 chunks +26 lines, -21 lines 0 comments Download
A chrome/browser/ui/views/browser_dialogs_views_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +27 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/website_settings/website_settings_popup_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/website_settings/website_settings_popup_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +30 lines, -8 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 5 6 7 5 chunks +12 lines, -11 lines 0 comments Download
M ui/views/bubble/bubble_delegate.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 40 (4 generated)
jackhou1
tapted, PTAL This seems to work except for the delay when the bubble appears. I ...
5 years, 4 months ago (2015-08-10 04:16:14 UTC) #2
tapted
we should double-check the impact to sizes too. It's "probably" small, but we need to ...
5 years, 4 months ago (2015-08-10 05:44:24 UTC) #3
tapted
oh, and it's possible a refactoring CL will need to land before this.. Maybe we ...
5 years, 4 months ago (2015-08-10 05:47:37 UTC) #4
jackhou1
> oh, and it's possible a refactoring CL will need to land before this.. Maybe ...
5 years, 4 months ago (2015-08-10 09:11:09 UTC) #5
tapted
On 2015/08/10 09:11:09, jackhou1 wrote: > > oh, and it's possible a refactoring CL will ...
5 years, 4 months ago (2015-08-11 00:44:35 UTC) #6
tapted
The coordinate_conversion stuff probably warrants its own CL since it needs a few cleanups too.. ...
5 years, 4 months ago (2015-08-11 01:23:20 UTC) #7
jackhou1
https://codereview.chromium.org/1280673003/diff/60001/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm File chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm (right): https://codereview.chromium.org/1280673003/diff/60001/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm#newcode786 chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm:786: [self setAnchorPoint:anchorPoint]; On 2015/08/11 01:23:19, tapted wrote: > nit: ...
5 years, 4 months ago (2015-08-11 03:09:24 UTC) #8
tapted
sorry.. found another spanner to throw :( https://codereview.chromium.org/1280673003/diff/80001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/80001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode33 chrome/browser/ui/views/browser_dialogs_views_mac.cc:33: 0, 0, ...
5 years, 4 months ago (2015-08-11 03:20:38 UTC) #9
tapted
https://codereview.chromium.org/1280673003/diff/80001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/80001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode33 chrome/browser/ui/views/browser_dialogs_views_mac.cc:33: 0, 0, anchor_point.x() * 2, On 2015/08/11 03:20:37, tapted ...
5 years, 4 months ago (2015-08-11 03:45:42 UTC) #10
jackhou1
https://codereview.chromium.org/1280673003/diff/80001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/80001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode33 chrome/browser/ui/views/browser_dialogs_views_mac.cc:33: 0, 0, anchor_point.x() * 2, On 2015/08/11 03:45:42, tapted ...
5 years, 4 months ago (2015-08-11 03:54:02 UTC) #11
jackhou1
msw, please review for OWNERS Also, you may have a better suggestion for how to ...
5 years, 4 months ago (2015-08-11 06:28:44 UTC) #13
msw
https://codereview.chromium.org/1280673003/diff/120001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/120001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode20 chrome/browser/ui/views/browser_dialogs_views_mac.cc:20: class BubbleAnchorViewAdapter : public views::WidgetObserver, Yeah, this seems far ...
5 years, 4 months ago (2015-08-11 22:09:11 UTC) #14
jackhou1
Just a question. (All of Sydney eng is at an offsite so I won't be ...
5 years, 4 months ago (2015-08-12 06:02:12 UTC) #15
msw
https://codereview.chromium.org/1280673003/diff/120001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/120001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode20 chrome/browser/ui/views/browser_dialogs_views_mac.cc:20: class BubbleAnchorViewAdapter : public views::WidgetObserver, On 2015/08/12 06:02:11, jackhou1 ...
5 years, 4 months ago (2015-08-12 16:52:43 UTC) #16
jackhou1
https://codereview.chromium.org/1280673003/diff/120001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/120001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode20 chrome/browser/ui/views/browser_dialogs_views_mac.cc:20: class BubbleAnchorViewAdapter : public views::WidgetObserver, On 2015/08/12 16:52:43, msw ...
5 years, 4 months ago (2015-08-17 04:54:19 UTC) #17
tapted
https://codereview.chromium.org/1280673003/diff/160001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/160001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode21 chrome/browser/ui/views/browser_dialogs_views_mac.cc:21: class BubbleAnchorAdapter : public views::WidgetObserver, (as discussed, I think ...
5 years, 4 months ago (2015-08-17 05:15:03 UTC) #18
tapted
https://codereview.chromium.org/1280673003/diff/160001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/160001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode21 chrome/browser/ui/views/browser_dialogs_views_mac.cc:21: class BubbleAnchorAdapter : public views::WidgetObserver, On 2015/08/17 05:15:03, tapted ...
5 years, 4 months ago (2015-08-17 05:15:45 UTC) #19
jackhou1
https://codereview.chromium.org/1280673003/diff/160001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/160001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode21 chrome/browser/ui/views/browser_dialogs_views_mac.cc:21: class BubbleAnchorAdapter : public views::WidgetObserver, On 2015/08/17 05:15:45, tapted ...
5 years, 4 months ago (2015-08-17 05:42:36 UTC) #20
tapted
https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc File chrome/browser/ui/views/website_settings/website_settings_popup_view.cc (right): https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc#newcode144 chrome/browser/ui/views/website_settings/website_settings_popup_view.cc:144: InternalPageInfoPopupView(views::View* anchor_view, nit: Maybe a comment here. E.g. it's ...
5 years, 4 months ago (2015-08-17 06:00:49 UTC) #21
jackhou1
https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc File chrome/browser/ui/views/website_settings/website_settings_popup_view.cc (right): https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc#newcode295 chrome/browser/ui/views/website_settings/website_settings_popup_view.cc:295: void WebsiteSettingsPopupView::ShowPopupAtRect( On 2015/08/17 06:00:49, tapted wrote: > I ...
5 years, 4 months ago (2015-08-17 06:19:13 UTC) #22
tapted
https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc File chrome/browser/ui/views/website_settings/website_settings_popup_view.cc (right): https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc#newcode295 chrome/browser/ui/views/website_settings/website_settings_popup_view.cc:295: void WebsiteSettingsPopupView::ShowPopupAtRect( On 2015/08/17 06:19:13, jackhou1 wrote: > On ...
5 years, 4 months ago (2015-08-17 06:30:57 UTC) #23
jackhou1
https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc File chrome/browser/ui/views/website_settings/website_settings_popup_view.cc (right): https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc#newcode295 chrome/browser/ui/views/website_settings/website_settings_popup_view.cc:295: void WebsiteSettingsPopupView::ShowPopupAtRect( On 2015/08/17 06:30:57, tapted wrote: > On ...
5 years, 4 months ago (2015-08-17 06:56:31 UTC) #24
jackhou1
https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc File chrome/browser/ui/views/website_settings/website_settings_popup_view.cc (right): https://codereview.chromium.org/1280673003/diff/180001/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc#newcode144 chrome/browser/ui/views/website_settings/website_settings_popup_view.cc:144: InternalPageInfoPopupView(views::View* anchor_view, On 2015/08/17 06:00:49, tapted wrote: > nit: ...
5 years, 4 months ago (2015-08-17 07:06:47 UTC) #25
tapted
lgtm
5 years, 4 months ago (2015-08-17 07:14:56 UTC) #26
jackhou1
msw, PTAL
5 years, 4 months ago (2015-08-17 07:31:54 UTC) #27
msw
Can you post screenshots of the bubble and the collected cookies dialog (Cocoa vs. Views) ...
5 years, 4 months ago (2015-08-17 17:31:45 UTC) #28
jackhou1
> Can you post screenshots of the bubble and the collected cookies dialog (Cocoa > ...
5 years, 4 months ago (2015-08-18 01:20:53 UTC) #29
tapted
https://codereview.chromium.org/1280673003/diff/220001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/220001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode11 chrome/browser/ui/views/browser_dialogs_views_mac.cc:11: // This file provides definitions of desktop browser dialog-creation ...
5 years, 4 months ago (2015-08-18 01:29:52 UTC) #30
msw
lgtm, thanks https://codereview.chromium.org/1280673003/diff/220001/chrome/browser/ui/views/browser_dialogs_views_mac.cc File chrome/browser/ui/views/browser_dialogs_views_mac.cc (right): https://codereview.chromium.org/1280673003/diff/220001/chrome/browser/ui/views/browser_dialogs_views_mac.cc#newcode11 chrome/browser/ui/views/browser_dialogs_views_mac.cc:11: // This file provides definitions of desktop ...
5 years, 4 months ago (2015-08-18 02:40:32 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1280673003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1280673003/240001
5 years, 4 months ago (2015-08-18 04:06:07 UTC) #34
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 4 months ago (2015-08-18 05:23:24 UTC) #35
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/700bafd0eba1167c3313739142e26dc10a46cd09 Cr-Commit-Position: refs/heads/master@{#343823}
5 years, 4 months ago (2015-08-18 05:24:31 UTC) #36
eugenebng
On 2015/08/18 05:24:31, commit-bot: I haz the power wrote: > Patchset 13 (id:??) landed as ...
5 years, 3 months ago (2015-09-09 16:01:03 UTC) #37
tapted
On 2015/09/09 16:01:03, eugenebng wrote: > On 2015/08/18 05:24:31, commit-bot: I haz the power wrote: ...
5 years, 3 months ago (2015-09-10 04:50:28 UTC) #38
tapted
On 2015/09/10 04:50:28, tapted wrote: > On 2015/09/09 16:01:03, eugenebng wrote: > > On 2015/08/18 ...
5 years, 3 months ago (2015-09-17 01:03:27 UTC) #39
eugenebng
5 years, 3 months ago (2015-09-17 15:10:58 UTC) #40
Message was sent while issue was closed.
On 2015/09/17 01:03:27, tapted wrote:
> On 2015/09/10 04:50:28, tapted wrote:
> > On 2015/09/09 16:01:03, eugenebng wrote:
> > > On 2015/08/18 05:24:31, commit-bot: I haz the power wrote:
> > > > Patchset 13 (id:??) landed as
> > > > https://crrev.com/700bafd0eba1167c3313739142e26dc10a46cd09
> > > > Cr-Commit-Position: refs/heads/master@{#343823}
> > > 
> > > this change causes both: 
> > > permissions_bubble_view.cc and permission_bubble_cocoa.mmincluded in
> > > toolit_views=1, mac_views_browser=0 configuration.
> > > Both of them having static scoped_ptr<PermissionBubbleView>
> > > PermissionBubbleView::Create implementation.
> > > Unfortunately, this doesn't cause linking error on mac.
> > > It looks like it should be fixed so that client code:
> > >
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ui/...
> > > will use views function with MacViewsDialogs and cocoa function withot
them.
> > Is
> > > that right?
> > 
> > Yeah - I think you're right. It looks like Chrome Mac is currently using
Cocoa
> > for permission bubbles on Mac regardless of the flag. That was the intention
> > (i.e. we didn't want to port those bubbles with this change - just the site
> > settings). But maybe that's luck :/. I'll investigate further when I'm back
> next
> > week.
> 
> Fix landed in http://crrev.com/349297
> 
> While toying with it, it looks like the linker accepted the ODR violation (and
> always used the Cocoa bubble), because if it *tried* to link the views
> permissions bubble, it
> would result in undefined references in
> PermissionBubbleViewViews::GetAnchorView(), so just ended up pruning the views
> duplicate.

Thank you very much. Haven't expected that fix already landed so quickly.

Powered by Google App Engine
This is Rietveld 408576698