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

Issue 16115010: ContentSettingImageView cleanup, phase 3. (Closed)

Created:
7 years, 6 months ago by Peter Kasting
Modified:
7 years, 6 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

ContentSettingImageView cleanup, phase 3. Swapping between BoxLayouts when the background toggles is confusing, and requires us to also add and remove children in order to get the padding right. Instead, just manually Layout(), which isn't hard, and allows us to create the text label in the constructor and just toggle its visibility instead of actually adding and removing it. This CL contains a few minor changes: * The label now obeys not only the passed-in font but also the color and y-position. * The label is now ALIGN_LEFT, which probably doesn't matter with NO_ELIDE but is more logical in principle (since we think of the label as being pinned to the icon on its left side). * The size calculations now cause the animation to smoothly grow from the size of the icon all the way out (and vice versa), rather than having the starting state of the animation be a jump (compared to the non-animating state) to immediately showing the background already expanded out to the margins around the icon. This is almost imperceptible at full speed but makes the animation slightly smoother. BUG=none TEST=none R=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203023

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -35 lines) Patch
M chrome/browser/ui/views/location_bar/content_setting_image_view.h View 3 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/location_bar/content_setting_image_view.cc View 6 chunks +34 lines, -30 lines 3 comments Download

Messages

Total messages: 6 (0 generated)
Peter Kasting
7 years, 6 months ago (2013-05-29 21:59:10 UTC) #1
Peter Kasting
https://codereview.chromium.org/16115010/diff/1/chrome/browser/ui/views/location_bar/content_setting_image_view.cc File chrome/browser/ui/views/location_bar/content_setting_image_view.cc (right): https://codereview.chromium.org/16115010/diff/1/chrome/browser/ui/views/location_bar/content_setting_image_view.cc#newcode210 chrome/browser/ui/views/location_bar/content_setting_image_view.cc:210: return kHorizMargin * 2 + kIconLabelSpacing; Forgot to comment ...
7 years, 6 months ago (2013-05-29 22:00:01 UTC) #2
sky
https://codereview.chromium.org/16115010/diff/1/chrome/browser/ui/views/location_bar/content_setting_image_view.cc File chrome/browser/ui/views/location_bar/content_setting_image_view.cc (right): https://codereview.chromium.org/16115010/diff/1/chrome/browser/ui/views/location_bar/content_setting_image_view.cc#newcode162 chrome/browser/ui/views/location_bar/content_setting_image_view.cc:162: void ContentSettingImageView::Layout() { Does this do the right thing ...
7 years, 6 months ago (2013-05-29 23:37:47 UTC) #3
Peter Kasting
https://codereview.chromium.org/16115010/diff/1/chrome/browser/ui/views/location_bar/content_setting_image_view.cc File chrome/browser/ui/views/location_bar/content_setting_image_view.cc (right): https://codereview.chromium.org/16115010/diff/1/chrome/browser/ui/views/location_bar/content_setting_image_view.cc#newcode162 chrome/browser/ui/views/location_bar/content_setting_image_view.cc:162: void ContentSettingImageView::Layout() { On 2013/05/29 23:37:47, sky wrote: > ...
7 years, 6 months ago (2013-05-29 23:54:52 UTC) #4
sky
I always get confused on when to use mirroring and when not. LGTM
7 years, 6 months ago (2013-05-30 00:02:59 UTC) #5
Peter Kasting
7 years, 6 months ago (2013-05-30 00:32:35 UTC) #6
Message was sent while issue was closed.
Committed patchset #1 manually as r203023 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698