summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/autocomplete
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-05 01:05:27 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-05 01:05:27 +0000
commit841f7a103cbd7be1cf95c4d147854355fd5bca99 (patch)
tree8b01c60bbe1c331d87124f7c942774659b9aae86 /chrome/browser/views/autocomplete
parent3266992f388387cb5f731cb36fa75d5ac65a7901 (diff)
downloadchromium_src-841f7a103cbd7be1cf95c4d147854355fd5bca99.zip
chromium_src-841f7a103cbd7be1cf95c4d147854355fd5bca99.tar.gz
chromium_src-841f7a103cbd7be1cf95c4d147854355fd5bca99.tar.bz2
Fix small pixel glitches in omnibox dropdown corners.
BUG=21146 TEST=Omnibox dropdown corners look nicer Review URL: http://codereview.chromium.org/201037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25568 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/autocomplete')
-rw-r--r--chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc14
-rw-r--r--chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h5
2 files changed, 15 insertions, 4 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
index 34e8831..f38a53e 100644
--- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -582,8 +582,11 @@ class PopupBorder : public views::Border {
// Returns the border radius of the edge of the popup.
static int GetBorderRadius() {
- InitClass();
- return dropshadow_topleft_->width() - dropshadow_left_->width() - 1;
+ // We can't safely calculate a border radius by comparing the sizes of the
+ // side and corner images, because either may have been extended in various
+ // directions in order to do more subtle dropshadow fading or other effects.
+ // So we hardcode the most accurate value.
+ return 4;
}
// Overridden from views::Border:
@@ -839,7 +842,7 @@ void AutocompletePopupContentsView::AnimationProgressed(
////////////////////////////////////////////////////////////////////////////////
// AutocompletePopupContentsView, views::View overrides:
-void AutocompletePopupContentsView::PaintChildren(gfx::Canvas* canvas) {
+void AutocompletePopupContentsView::Paint(gfx::Canvas* canvas) {
// We paint our children in an unconventional way.
//
// Because the border of this view creates an anti-aliased round-rect region
@@ -873,6 +876,11 @@ void AutocompletePopupContentsView::PaintChildren(gfx::Canvas* canvas) {
gfx::Path path;
MakeContentsPath(&path, GetLocalBounds(false));
canvas->drawPath(path, paint);
+
+ // Now we paint the border, so it will be alpha-blended atop the contents.
+ // This looks slightly better in the corners than drawing the contents atop
+ // the border.
+ PaintBorder(canvas);
}
void AutocompletePopupContentsView::Layout() {
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
index ae1e852..8a50923 100644
--- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
+++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
@@ -79,7 +79,10 @@ class AutocompletePopupContentsView : public views::View,
virtual void AnimationProgressed(const Animation* animation);
// Overridden from views::View:
- virtual void PaintChildren(gfx::Canvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
+ virtual void PaintChildren(gfx::Canvas* canvas) {
+ // We paint our children inside Paint().
+ }
virtual void Layout();
private: