OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/bubble/tray_bubble_view.h" | 5 #include "ui/views/bubble/tray_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 if (preferred_width_ == width) | 374 if (preferred_width_ == width) |
375 return; | 375 return; |
376 preferred_width_ = width; | 376 preferred_width_ = width; |
377 if (GetWidget()) | 377 if (GetWidget()) |
378 SizeToContents(); | 378 SizeToContents(); |
379 } | 379 } |
380 | 380 |
381 void TrayBubbleView::SetArrowPaintType( | 381 void TrayBubbleView::SetArrowPaintType( |
382 views::BubbleBorder::ArrowPaintType paint_type) { | 382 views::BubbleBorder::ArrowPaintType paint_type) { |
383 bubble_border_->set_paint_arrow(paint_type); | 383 bubble_border_->set_paint_arrow(paint_type); |
| 384 UpdateBubble(); |
384 } | 385 } |
385 | 386 |
386 gfx::Insets TrayBubbleView::GetBorderInsets() const { | 387 gfx::Insets TrayBubbleView::GetBorderInsets() const { |
387 return bubble_border_->GetInsets(); | 388 return bubble_border_->GetInsets(); |
388 } | 389 } |
389 | 390 |
390 void TrayBubbleView::Init() { | 391 void TrayBubbleView::Init() { |
391 BoxLayout* layout = new BottomAlignedBoxLayout(this); | 392 BoxLayout* layout = new BottomAlignedBoxLayout(this); |
392 layout->SetDefaultFlex(1); | 393 layout->SetDefaultFlex(1); |
393 SetLayoutManager(layout); | 394 SetLayoutManager(layout); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 void TrayBubbleView::ViewHierarchyChanged( | 501 void TrayBubbleView::ViewHierarchyChanged( |
501 const ViewHierarchyChangedDetails& details) { | 502 const ViewHierarchyChangedDetails& details) { |
502 if (details.is_add && details.child == this) { | 503 if (details.is_add && details.child == this) { |
503 details.parent->SetPaintToLayer(true); | 504 details.parent->SetPaintToLayer(true); |
504 details.parent->SetFillsBoundsOpaquely(true); | 505 details.parent->SetFillsBoundsOpaquely(true); |
505 details.parent->layer()->SetMasksToBounds(true); | 506 details.parent->layer()->SetMasksToBounds(true); |
506 } | 507 } |
507 } | 508 } |
508 | 509 |
509 } // namespace views | 510 } // namespace views |
OLD | NEW |