diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 23:04:48 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 23:04:48 +0000 |
commit | 7deaa81460cae8f40cbd3408a611527b2299c354 (patch) | |
tree | df5bd337270d024838b2b83595c970156e741f85 /chrome/browser/views/hwnd_html_view.cc | |
parent | 12a7aa885e5067665577bb86b20f004f0e8c57cb (diff) | |
download | chromium_src-7deaa81460cae8f40cbd3408a611527b2299c354.zip chromium_src-7deaa81460cae8f40cbd3408a611527b2299c354.tar.gz chromium_src-7deaa81460cae8f40cbd3408a611527b2299c354.tar.bz2 |
Fix several painting glitches for toolstrips.
* Reset HWND size when HWNDHtmlView changes size. The two should always be in sync.
* Race: We might already have frames when RenderWidget receives a new background, need to set these to transparent too.
* Race: Toolstrip background not always available by the time ExtensionToolstrip is constucted
* Make images line up correctly for toolstrip buttons.
Review URL: http://codereview.chromium.org/99042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14682 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/hwnd_html_view.cc')
-rw-r--r-- | chrome/browser/views/hwnd_html_view.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/views/hwnd_html_view.cc b/chrome/browser/views/hwnd_html_view.cc index a0174d6..6856f57 100644 --- a/chrome/browser/views/hwnd_html_view.cc +++ b/chrome/browser/views/hwnd_html_view.cc @@ -32,6 +32,28 @@ HWNDHtmlView::~HWNDHtmlView() { } } +void HWNDHtmlView::SetVisible(bool is_visible) { + HWNDView::SetVisible(is_visible); + + // Also tell RenderWidgetHostView the new visibility. Despite its name, it is + // not part of the View heirarchy and does not know about the change unless we + // tell it. + if (render_view_host() && render_view_host()->view()) { + if (is_visible) + render_view_host()->view()->Show(); + else + render_view_host()->view()->Hide(); + } +} + +void HWNDHtmlView::DidChangeBounds(const gfx::Rect& previous, + const gfx::Rect& current) { + // Propagate the new size to RenderWidgetHostView. + // We can't send size zero because RenderWidget DCHECKs that. + if (render_view_host() && render_view_host()->view() && !current.IsEmpty()) + render_view_host()->view()->SetSize(gfx::Size(width(), height())); +} + void HWNDHtmlView::SetBackground(const SkBitmap& background) { if (initialized_) { DCHECK(render_view_host_); |