OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_dialog_delegate.h" | 5 #include "ui/views/bubble/bubble_dialog_delegate.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "ui/accessibility/ax_node_data.h" | 8 #include "ui/accessibility/ax_node_data.h" |
9 #include "ui/base/default_style.h" | 9 #include "ui/base/default_style.h" |
10 #include "ui/base/material_design/material_design_controller.h" | 10 #include "ui/base/material_design/material_design_controller.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 anchor_widget_(NULL), | 210 anchor_widget_(NULL), |
211 arrow_(arrow), | 211 arrow_(arrow), |
212 mirror_arrow_in_rtl_(PlatformStyle::kMirrorBubbleArrowInRTLByDefault), | 212 mirror_arrow_in_rtl_(PlatformStyle::kMirrorBubbleArrowInRTLByDefault), |
213 shadow_(BubbleBorder::SMALL_SHADOW), | 213 shadow_(BubbleBorder::SMALL_SHADOW), |
214 color_explicitly_set_(false), | 214 color_explicitly_set_(false), |
215 accept_events_(true), | 215 accept_events_(true), |
216 adjust_if_offscreen_(true), | 216 adjust_if_offscreen_(true), |
217 parent_window_(NULL) { | 217 parent_window_(NULL) { |
218 LayoutProvider* provider = LayoutProvider::Get(); | 218 LayoutProvider* provider = LayoutProvider::Get(); |
219 margins_ = provider->GetInsetsMetric(INSETS_BUBBLE_CONTENTS); | 219 margins_ = provider->GetInsetsMetric(INSETS_BUBBLE_CONTENTS); |
220 title_margins_ = provider->GetInsetsMetric(INSETS_DIALOG_TITLE); | 220 title_margins_ = provider->GetInsetsMetric(INSETS_BUBBLE_TITLE); |
221 if (anchor_view) | 221 if (anchor_view) |
222 SetAnchorView(anchor_view); | 222 SetAnchorView(anchor_view); |
223 UpdateColorsFromTheme(GetNativeTheme()); | 223 UpdateColorsFromTheme(GetNativeTheme()); |
224 } | 224 } |
225 | 225 |
226 gfx::Rect BubbleDialogDelegateView::GetBubbleBounds() { | 226 gfx::Rect BubbleDialogDelegateView::GetBubbleBounds() { |
227 // The argument rect has its origin at the bubble's arrow anchor point; | 227 // The argument rect has its origin at the bubble's arrow anchor point; |
228 // its size is the preferred size of the bubble's client view (this view). | 228 // its size is the preferred size of the bubble's client view (this view). |
229 bool anchor_minimized = anchor_widget() && anchor_widget()->IsMinimized(); | 229 bool anchor_minimized = anchor_widget() && anchor_widget()->IsMinimized(); |
230 return GetBubbleFrameView()->GetUpdatedWindowBounds( | 230 return GetBubbleFrameView()->GetUpdatedWindowBounds( |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // http://crbug.com/474622 for details. | 320 // http://crbug.com/474622 for details. |
321 if (widget == GetWidget() && visible) { | 321 if (widget == GetWidget() && visible) { |
322 ui::AXNodeData node_data; | 322 ui::AXNodeData node_data; |
323 GetAccessibleNodeData(&node_data); | 323 GetAccessibleNodeData(&node_data); |
324 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) | 324 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) |
325 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 325 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 } // namespace views | 329 } // namespace views |
OLD | NEW |