Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: ui/views/bubble/bubble_dialog_delegate.cc

Issue 2532613002: MacViews: fix bubble direction in RTL. (Closed)
Patch Set: Use the advice in buildflag.h? Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/material_design/material_design_controller.h" 9 #include "ui/base/material_design/material_design_controller.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/gfx/color_utils.h" 11 #include "ui/gfx/color_utils.h"
12 #include "ui/gfx/geometry/rect.h" 12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/native_theme/native_theme.h" 13 #include "ui/native_theme/native_theme.h"
14 #include "ui/views/bubble/bubble_frame_view.h" 14 #include "ui/views/bubble/bubble_frame_view.h"
15 #include "ui/views/focus/view_storage.h" 15 #include "ui/views/focus/view_storage.h"
16 #include "ui/views/layout/layout_constants.h" 16 #include "ui/views/layout/layout_constants.h"
17 #include "ui/views/style/platform_style.h"
17 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
18 #include "ui/views/widget/widget_observer.h" 19 #include "ui/views/widget/widget_observer.h"
19 #include "ui/views/window/dialog_client_view.h" 20 #include "ui/views/window/dialog_client_view.h"
20 21
21 #if defined(OS_WIN) 22 #if defined(OS_WIN)
22 #include "ui/base/win/shell.h" 23 #include "ui/base/win/shell.h"
23 #endif 24 #endif
24 25
25 namespace views { 26 namespace views {
26 27
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 202
202 BubbleDialogDelegateView::BubbleDialogDelegateView() 203 BubbleDialogDelegateView::BubbleDialogDelegateView()
203 : BubbleDialogDelegateView(nullptr, BubbleBorder::TOP_LEFT) {} 204 : BubbleDialogDelegateView(nullptr, BubbleBorder::TOP_LEFT) {}
204 205
205 BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view, 206 BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view,
206 BubbleBorder::Arrow arrow) 207 BubbleBorder::Arrow arrow)
207 : close_on_deactivate_(true), 208 : close_on_deactivate_(true),
208 anchor_view_storage_id_(ViewStorage::GetInstance()->CreateStorageID()), 209 anchor_view_storage_id_(ViewStorage::GetInstance()->CreateStorageID()),
209 anchor_widget_(NULL), 210 anchor_widget_(NULL),
210 arrow_(arrow), 211 arrow_(arrow),
211 mirror_arrow_in_rtl_(true), 212 mirror_arrow_in_rtl_(PlatformStyle::kMirrorBubbleArrowInRTLByDefault),
212 shadow_(BubbleBorder::SMALL_SHADOW), 213 shadow_(BubbleBorder::SMALL_SHADOW),
213 color_explicitly_set_(false), 214 color_explicitly_set_(false),
214 margins_(kPanelVertMargin, 215 margins_(kPanelVertMargin,
215 kPanelHorizMargin, 216 kPanelHorizMargin,
216 kPanelVertMargin, 217 kPanelVertMargin,
217 kPanelHorizMargin), 218 kPanelHorizMargin),
218 accept_events_(true), 219 accept_events_(true),
219 border_accepts_events_(true), 220 border_accepts_events_(true),
220 adjust_if_offscreen_(true), 221 adjust_if_offscreen_(true),
221 parent_window_(NULL) { 222 parent_window_(NULL) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // http://crbug.com/474622 for details. 320 // http://crbug.com/474622 for details.
320 if (widget == GetWidget() && visible) { 321 if (widget == GetWidget() && visible) {
321 ui::AXNodeData node_data; 322 ui::AXNodeData node_data;
322 GetAccessibleNodeData(&node_data); 323 GetAccessibleNodeData(&node_data);
323 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) 324 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG)
324 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 325 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
325 } 326 }
326 } 327 }
327 328
328 } // namespace views 329 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698