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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } | 384 } |
385 | 385 |
386 gfx::Insets TrayBubbleView::GetBorderInsets() const { | 386 gfx::Insets TrayBubbleView::GetBorderInsets() const { |
387 return bubble_border_->GetInsets(); | 387 return bubble_border_->GetInsets(); |
388 } | 388 } |
389 | 389 |
390 void TrayBubbleView::Init() { | 390 void TrayBubbleView::Init() { |
391 BoxLayout* layout = new BottomAlignedBoxLayout(this); | 391 BoxLayout* layout = new BottomAlignedBoxLayout(this); |
392 layout->set_spread_blank_space(true); | 392 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL); |
393 SetLayoutManager(layout); | 393 SetLayoutManager(layout); |
394 } | 394 } |
395 | 395 |
396 gfx::Rect TrayBubbleView::GetAnchorRect() { | 396 gfx::Rect TrayBubbleView::GetAnchorRect() { |
397 if (!delegate_) | 397 if (!delegate_) |
398 return gfx::Rect(); | 398 return gfx::Rect(); |
399 return delegate_->GetAnchorRect(anchor_widget(), | 399 return delegate_->GetAnchorRect(anchor_widget(), |
400 params_.anchor_type, | 400 params_.anchor_type, |
401 params_.anchor_alignment); | 401 params_.anchor_alignment); |
402 } | 402 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 void TrayBubbleView::ViewHierarchyChanged( | 500 void TrayBubbleView::ViewHierarchyChanged( |
501 const ViewHierarchyChangedDetails& details) { | 501 const ViewHierarchyChangedDetails& details) { |
502 if (details.is_add && details.child == this) { | 502 if (details.is_add && details.child == this) { |
503 details.parent->SetPaintToLayer(true); | 503 details.parent->SetPaintToLayer(true); |
504 details.parent->SetFillsBoundsOpaquely(true); | 504 details.parent->SetFillsBoundsOpaquely(true); |
505 details.parent->layer()->SetMasksToBounds(true); | 505 details.parent->layer()->SetMasksToBounds(true); |
506 } | 506 } |
507 } | 507 } |
508 | 508 |
509 } // namespace views | 509 } // namespace views |
OLD | NEW |