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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 if (delegate_) | 389 if (delegate_) |
390 delegate_->OnMouseEnteredView(); | 390 delegate_->OnMouseEnteredView(); |
391 } | 391 } |
392 | 392 |
393 void TrayBubbleView::OnMouseExited(const ui::MouseEvent& event) { | 393 void TrayBubbleView::OnMouseExited(const ui::MouseEvent& event) { |
394 if (delegate_) | 394 if (delegate_) |
395 delegate_->OnMouseExitedView(); | 395 delegate_->OnMouseExitedView(); |
396 } | 396 } |
397 | 397 |
398 void TrayBubbleView::GetAccessibleState(ui::AccessibleViewState* state) { | 398 void TrayBubbleView::GetAccessibleState(ui::AccessibleViewState* state) { |
399 if (params_.can_activate) { | 399 if (delegate_ && params_.can_activate) { |
400 state->role = ui::AccessibilityTypes::ROLE_WINDOW; | 400 state->role = ui::AccessibilityTypes::ROLE_WINDOW; |
401 state->name = delegate_->GetAccessibleNameForBubble(); | 401 state->name = delegate_->GetAccessibleNameForBubble(); |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
405 void TrayBubbleView::ChildPreferredSizeChanged(View* child) { | 405 void TrayBubbleView::ChildPreferredSizeChanged(View* child) { |
406 SizeToContents(); | 406 SizeToContents(); |
407 } | 407 } |
408 | 408 |
409 void TrayBubbleView::ViewHierarchyChanged( | 409 void TrayBubbleView::ViewHierarchyChanged( |
410 const ViewHierarchyChangedDetails& details) { | 410 const ViewHierarchyChangedDetails& details) { |
411 if (get_use_acceleration_when_possible() && details.is_add && | 411 if (get_use_acceleration_when_possible() && details.is_add && |
412 details.child == this) { | 412 details.child == this) { |
413 details.parent->SetPaintToLayer(true); | 413 details.parent->SetPaintToLayer(true); |
414 details.parent->SetFillsBoundsOpaquely(true); | 414 details.parent->SetFillsBoundsOpaquely(true); |
415 details.parent->layer()->SetMasksToBounds(true); | 415 details.parent->layer()->SetMasksToBounds(true); |
416 } | 416 } |
417 } | 417 } |
418 | 418 |
419 } // namespace views | 419 } // namespace views |
OLD | NEW |