| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/accessibility/ax_view_state.h" | 8 #include "ui/accessibility/ax_view_state.h" |
| 9 #include "ui/base/default_style.h" | 9 #include "ui/base/default_style.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 gfx::Insets(kPanelVertMargin, kPanelHorizMargin, 0, kPanelHorizMargin), | 125 gfx::Insets(kPanelVertMargin, kPanelHorizMargin, 0, kPanelHorizMargin), |
| 126 margins()); | 126 margins()); |
| 127 // Note: In CreateBubble, the call to SizeToContents() will cause | 127 // Note: In CreateBubble, the call to SizeToContents() will cause |
| 128 // the relayout that this call requires. | 128 // the relayout that this call requires. |
| 129 frame->SetTitleFontList(GetTitleFontList()); | 129 frame->SetTitleFontList(GetTitleFontList()); |
| 130 frame->SetFootnoteView(CreateFootnoteView()); | 130 frame->SetFootnoteView(CreateFootnoteView()); |
| 131 | 131 |
| 132 BubbleBorder::Arrow adjusted_arrow = arrow(); | 132 BubbleBorder::Arrow adjusted_arrow = arrow(); |
| 133 if (base::i18n::IsRTL()) | 133 if (base::i18n::IsRTL()) |
| 134 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); | 134 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); |
| 135 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>( | 135 frame->SetBubbleBorder(std::unique_ptr<BubbleBorder>( |
| 136 new BubbleBorder(adjusted_arrow, shadow(), color()))); | 136 new BubbleBorder(adjusted_arrow, shadow(), color()))); |
| 137 return frame; | 137 return frame; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void BubbleDelegateView::GetAccessibleState(ui::AXViewState* state) { | 140 void BubbleDelegateView::GetAccessibleState(ui::AXViewState* state) { |
| 141 state->role = ui::AX_ROLE_DIALOG; | 141 state->role = ui::AX_ROLE_DIALOG; |
| 142 } | 142 } |
| 143 | 143 |
| 144 const char* BubbleDelegateView::GetClassName() const { | 144 const char* BubbleDelegateView::GetClassName() const { |
| 145 return kViewClassName; | 145 return kViewClassName; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 // http://crbug.com/474622 for details. | 326 // http://crbug.com/474622 for details. |
| 327 if (widget == GetWidget() && visible) { | 327 if (widget == GetWidget() && visible) { |
| 328 ui::AXViewState state; | 328 ui::AXViewState state; |
| 329 GetAccessibleState(&state); | 329 GetAccessibleState(&state); |
| 330 if (state.role == ui::AX_ROLE_ALERT_DIALOG) | 330 if (state.role == ui::AX_ROLE_ALERT_DIALOG) |
| 331 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 331 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace views | 335 } // namespace views |
| OLD | NEW |