| 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/window/dialog_delegate.h" | 5 #include "ui/views/window/dialog_delegate.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #endif | 75 #endif |
| 76 } | 76 } |
| 77 params.context = context; | 77 params.context = context; |
| 78 params.parent = parent; | 78 params.parent = parent; |
| 79 #if !defined(OS_MACOSX) | 79 #if !defined(OS_MACOSX) |
| 80 // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child | 80 // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child |
| 81 // widgets to prevent top-level window behavior (independent movement, etc). | 81 // widgets to prevent top-level window behavior (independent movement, etc). |
| 82 // On Mac, however, the parent may be a native window (not a views::Widget), | 82 // On Mac, however, the parent may be a native window (not a views::Widget), |
| 83 // and so the dialog must be considered top-level to gain focus and input | 83 // and so the dialog must be considered top-level to gain focus and input |
| 84 // method behaviors. | 84 // method behaviors. |
| 85 params.child = parent && (delegate->GetModalType() == ui::MODAL_TYPE_CHILD); | 85 params.child = parent && (delegate->GetModalType() == ui::MODAL_TYPE_CHILD) |
| 86 && !delegate->IsTopLevel(); |
| 86 #endif | 87 #endif |
| 87 return params; | 88 return params; |
| 88 } | 89 } |
| 89 | 90 |
| 90 View* DialogDelegate::CreateExtraView() { | 91 View* DialogDelegate::CreateExtraView() { |
| 91 return NULL; | 92 return NULL; |
| 92 } | 93 } |
| 93 | 94 |
| 94 bool DialogDelegate::GetExtraViewPadding(int* padding) { | 95 bool DialogDelegate::GetExtraViewPadding(int* padding) { |
| 95 return false; | 96 return false; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 state->role = ui::AX_ROLE_DIALOG; | 254 state->role = ui::AX_ROLE_DIALOG; |
| 254 } | 255 } |
| 255 | 256 |
| 256 void DialogDelegateView::ViewHierarchyChanged( | 257 void DialogDelegateView::ViewHierarchyChanged( |
| 257 const ViewHierarchyChangedDetails& details) { | 258 const ViewHierarchyChangedDetails& details) { |
| 258 if (details.is_add && details.child == this && GetWidget()) | 259 if (details.is_add && details.child == this && GetWidget()) |
| 259 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 260 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 260 } | 261 } |
| 261 | 262 |
| 262 } // namespace views | 263 } // namespace views |
| OLD | NEW |