| 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/bubble_delegate.h" | 5 #include "ui/views/bubble/bubble_delegate.h" |
| 6 | 6 |
| 7 #include "ui/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
| 8 #include "ui/gfx/animation/slide_animation.h" | 8 #include "ui/gfx/animation/slide_animation.h" |
| 9 #include "ui/gfx/color_utils.h" | 9 #include "ui/gfx/color_utils.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 View* BubbleDelegateView::GetContentsView() { | 129 View* BubbleDelegateView::GetContentsView() { |
| 130 return this; | 130 return this; |
| 131 } | 131 } |
| 132 | 132 |
| 133 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( | 133 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( |
| 134 Widget* widget) { | 134 Widget* widget) { |
| 135 BubbleFrameView* frame = new BubbleFrameView(margins()); | 135 BubbleFrameView* frame = new BubbleFrameView(margins()); |
| 136 BubbleBorder::Arrow adjusted_arrow = arrow(); | 136 BubbleBorder::Arrow adjusted_arrow = arrow(); |
| 137 if (base::i18n::IsRTL()) | 137 if (base::i18n::IsRTL()) |
| 138 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); | 138 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); |
| 139 frame->SetBubbleBorder(new BubbleBorder(adjusted_arrow, shadow(), color())); | 139 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>( |
| 140 new BubbleBorder(adjusted_arrow, shadow(), color()))); |
| 140 return frame; | 141 return frame; |
| 141 } | 142 } |
| 142 | 143 |
| 143 void BubbleDelegateView::GetAccessibleState(ui::AccessibleViewState* state) { | 144 void BubbleDelegateView::GetAccessibleState(ui::AccessibleViewState* state) { |
| 144 state->role = ui::AccessibilityTypes::ROLE_DIALOG; | 145 state->role = ui::AccessibilityTypes::ROLE_DIALOG; |
| 145 } | 146 } |
| 146 | 147 |
| 147 void BubbleDelegateView::OnWidgetDestroying(Widget* widget) { | 148 void BubbleDelegateView::OnWidgetDestroying(Widget* widget) { |
| 148 if (anchor_widget() == widget) | 149 if (anchor_widget() == widget) |
| 149 SetAnchorView(NULL); | 150 SetAnchorView(NULL); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 } | 342 } |
| 342 | 343 |
| 343 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { | 344 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { |
| 344 if (widget == GetWidget() && visible && anchor_widget() && | 345 if (widget == GetWidget() && visible && anchor_widget() && |
| 345 anchor_widget()->GetTopLevelWidget()) { | 346 anchor_widget()->GetTopLevelWidget()) { |
| 346 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); | 347 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); |
| 347 } | 348 } |
| 348 } | 349 } |
| 349 | 350 |
| 350 } // namespace views | 351 } // namespace views |
| OLD | NEW |