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 "base/macros.h" | 9 #include "base/macros.h" |
10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 420 |
421 bool TrayBubbleView::WidgetHasHitTestMask() const { | 421 bool TrayBubbleView::WidgetHasHitTestMask() const { |
422 return true; | 422 return true; |
423 } | 423 } |
424 | 424 |
425 void TrayBubbleView::GetWidgetHitTestMask(gfx::Path* mask) const { | 425 void TrayBubbleView::GetWidgetHitTestMask(gfx::Path* mask) const { |
426 DCHECK(mask); | 426 DCHECK(mask); |
427 mask->addRect(gfx::RectToSkRect(GetBubbleFrameView()->GetContentsBounds())); | 427 mask->addRect(gfx::RectToSkRect(GetBubbleFrameView()->GetContentsBounds())); |
428 } | 428 } |
429 | 429 |
| 430 base::string16 TrayBubbleView::GetAccessibleWindowTitle() const { |
| 431 return delegate_->GetAccessibleNameForBubble(); |
| 432 } |
| 433 |
430 gfx::Size TrayBubbleView::GetPreferredSize() const { | 434 gfx::Size TrayBubbleView::GetPreferredSize() const { |
431 return gfx::Size(preferred_width_, GetHeightForWidth(preferred_width_)); | 435 return gfx::Size(preferred_width_, GetHeightForWidth(preferred_width_)); |
432 } | 436 } |
433 | 437 |
434 gfx::Size TrayBubbleView::GetMaximumSize() const { | 438 gfx::Size TrayBubbleView::GetMaximumSize() const { |
435 gfx::Size size = GetPreferredSize(); | 439 gfx::Size size = GetPreferredSize(); |
436 size.set_width(params_.max_width); | 440 size.set_width(params_.max_width); |
437 return size; | 441 return size; |
438 } | 442 } |
439 | 443 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 510 |
507 void TrayBubbleView::ViewHierarchyChanged( | 511 void TrayBubbleView::ViewHierarchyChanged( |
508 const ViewHierarchyChangedDetails& details) { | 512 const ViewHierarchyChangedDetails& details) { |
509 if (details.is_add && details.child == this) { | 513 if (details.is_add && details.child == this) { |
510 details.parent->SetPaintToLayer(true); | 514 details.parent->SetPaintToLayer(true); |
511 details.parent->layer()->SetMasksToBounds(true); | 515 details.parent->layer()->SetMasksToBounds(true); |
512 } | 516 } |
513 } | 517 } |
514 | 518 |
515 } // namespace views | 519 } // namespace views |
OLD | NEW |