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

Issue 1472023004: Updated DropdownBarHost to use Layer clipping instead of OnPaint() clipping. (Closed)

Created:
5 years ago by bruthig
Modified:
5 years ago
Reviewers:
ajuma, Peter Kasting
CC:
chromium-reviews, tfarina, dcheng
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Updated DropdownBarHost to use Layer clipping instead of OnPaint() clipping. The Material Design ink drop ripple was recently applied to the material design find in page dialog (https://codereview.chromium.org/1396903003). This change required that some Views to paint to layers unfortunately the clipping mechanism used for the find in page bar only applied to the OnPaint() methods and did not work to clip layer trees. This CL sets the contents view for the DropdownBarHost::widget_ to be a new clipping view, and the FindBarView is added as a child to the clipping view instead of as the DropdownBarHost::widget_'s contents view. This CL has the added benefit that the the drop down bars will not need to be repainted anymore for each animation frame. TEST=Open the find in page bar with material design turned on. Click and hold on the close button so the ink drop ripple is visible. Hit the Esc key to dismiss the dialog. The back button/ripple should not appear over top of the toolbar and should be clipped at the same horizontal line as the rest of the dialog. BUG=549621 Committed: https://crrev.com/ea9b0ba419a3598bdb7f7c62afdf4409afa73ab1 Cr-Commit-Position: refs/heads/master@{#361695}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Addressed comments from patch set 1. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -106 lines) Patch
M chrome/browser/ui/views/dropdown_bar_host.h View 1 3 chunks +7 lines, -10 lines 0 comments Download
M chrome/browser/ui/views/dropdown_bar_host.cc View 1 6 chunks +28 lines, -17 lines 0 comments Download
M chrome/browser/ui/views/dropdown_bar_host_delegate.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/dropdown_bar_view.h View 2 chunks +0 lines, -16 lines 0 comments Download
M chrome/browser/ui/views/dropdown_bar_view.cc View 2 chunks +1 line, -35 lines 0 comments Download
M chrome/browser/ui/views/find_bar_host.cc View 1 chunk +2 lines, -9 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.h View 3 chunks +0 lines, -10 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 2 chunks +0 lines, -5 lines 0 comments Download

Messages

Total messages: 16 (7 generated)
bruthig
pkasting@, can you PTAL?
5 years ago (2015-11-24 21:44:18 UTC) #2
Peter Kasting
I understand nothing about layers in Views, so most of the functional changes in here ...
5 years ago (2015-11-24 22:39:43 UTC) #3
bruthig
ajuma@, can you take a look at the use of layers in this patch and ...
5 years ago (2015-11-25 13:28:55 UTC) #5
ajuma
On 2015/11/25 13:28:55, bruthig wrote: > ajuma@, can you take a look at the use ...
5 years ago (2015-11-25 14:34:02 UTC) #6
bruthig
I have addressed comments and will assume previous LGTM's still stand. pkasting@, can you look ...
5 years ago (2015-11-25 16:55:07 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472023004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472023004/20001
5 years ago (2015-11-25 17:53:40 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years ago (2015-11-25 18:00:17 UTC) #13
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/ea9b0ba419a3598bdb7f7c62afdf4409afa73ab1 Cr-Commit-Position: refs/heads/master@{#361695}
5 years ago (2015-11-25 18:01:25 UTC) #15
Peter Kasting
5 years ago (2015-11-25 23:16:54 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/1472023004/diff/1/chrome/browser/ui/views/dro...
File chrome/browser/ui/views/dropdown_bar_host.cc (right):

https://codereview.chromium.org/1472023004/diff/1/chrome/browser/ui/views/dro...
chrome/browser/ui/views/dropdown_bar_host.cc:151: return;
On 2015/11/25 16:55:06, bruthig wrote:
> On 2015/11/24 22:39:43, Peter Kasting wrote:
> > Should this hide the host if it's currently visible?
> 
> No, not from what I can tell anyway.  From what I can tell the host()->Show()
> call below shouldn't be necessary either so I've removed that.  It should be
> more consistent now.

I don't really know what this code does so I can't speak to it either way.

You might rewrite this function for brevity as

  view_->SetSize(new_pos.size());
  if (!new_pos.IsEmpty())
    host()->SetBounds(new_pos);

But it's minor so feel free not to if you don't want.

Powered by Google App Engine
This is Rietveld 408576698