summaryrefslogtreecommitdiffstats
path: root/ash/wm
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 19:14:04 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 19:14:04 +0000
commitfb1a9cc00e8249f805f2446f7c32fb5a87b63705 (patch)
treeb4eaa510ba75bd7c4f49c8a6b98d2f01dcb0947e /ash/wm
parent320967b246cb2fbcba4a64fb85a3352e3ab5ff54 (diff)
downloadchromium_src-fb1a9cc00e8249f805f2446f7c32fb5a87b63705.zip
chromium_src-fb1a9cc00e8249f805f2446f7c32fb5a87b63705.tar.gz
chromium_src-fb1a9cc00e8249f805f2446f7c32fb5a87b63705.tar.bz2
Automatically repaint when a child view is added or going to be removed.
BUG=333173 TEST=Changing between tabs with translate infobars for different source languages should redraw the infobars. R=sky@chromium.org Review URL: https://codereview.chromium.org/138143023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm')
-rw-r--r--ash/wm/custom_frame_view_ash.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/ash/wm/custom_frame_view_ash.cc b/ash/wm/custom_frame_view_ash.cc
index be5886b..8df509c 100644
--- a/ash/wm/custom_frame_view_ash.cc
+++ b/ash/wm/custom_frame_view_ash.cc
@@ -472,11 +472,16 @@ gfx::Size CustomFrameViewAsh::GetMaximumSize() {
}
void CustomFrameViewAsh::SchedulePaintInRect(const gfx::Rect& r) {
- // The HeaderView is not a child of CustomFrameViewAsh. Redirect the paint to
- // HeaderView instead.
- gfx::RectF to_paint(r);
- views::View::ConvertRectToTarget(this, header_view_, &to_paint);
- header_view_->SchedulePaintInRect(gfx::ToEnclosingRect(to_paint));
+ // We may end up here before |header_view_| has been added to the Widget.
+ if (header_view_->GetWidget()) {
+ // The HeaderView is not a child of CustomFrameViewAsh. Redirect the paint
+ // to HeaderView instead.
+ gfx::RectF to_paint(r);
+ views::View::ConvertRectToTarget(this, header_view_, &to_paint);
+ header_view_->SchedulePaintInRect(gfx::ToEnclosingRect(to_paint));
+ } else {
+ views::NonClientFrameView::SchedulePaintInRect(r);
+ }
}
bool CustomFrameViewAsh::HitTestRect(const gfx::Rect& rect) const {