| 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/controls/message_box_view.h" | 5 #include "ui/views/controls/message_box_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 /////////////////////////////////////////////////////////////////////////////// | 125 /////////////////////////////////////////////////////////////////////////////// |
| 126 // MessageBoxView, View overrides: | 126 // MessageBoxView, View overrides: |
| 127 | 127 |
| 128 void MessageBoxView::ViewHierarchyChanged(bool is_add, | 128 void MessageBoxView::ViewHierarchyChanged(bool is_add, |
| 129 View* parent, | 129 View* parent, |
| 130 View* child) { | 130 View* child) { |
| 131 if (child == this && is_add) { | 131 if (child == this && is_add) { |
| 132 if (prompt_field_) | 132 if (prompt_field_) |
| 133 prompt_field_->SelectAll(true); | 133 prompt_field_->SelectAll(true); |
| 134 | 134 |
| 135 GetWidget()->NotifyAccessibilityEvent( | 135 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, true); |
| 136 this, ui::AccessibilityTypes::EVENT_ALERT, true); | |
| 137 } | 136 } |
| 138 } | 137 } |
| 139 | 138 |
| 140 bool MessageBoxView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 139 bool MessageBoxView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 141 // We only accepts Ctrl-C. | 140 // We only accepts Ctrl-C. |
| 142 DCHECK(accelerator.key_code() == 'C' && accelerator.IsCtrlDown()); | 141 DCHECK(accelerator.key_code() == 'C' && accelerator.IsCtrlDown()); |
| 143 | 142 |
| 144 // We must not intercept Ctrl-C when we have a text box and it's focused. | 143 // We must not intercept Ctrl-C when we have a text box and it's focused. |
| 145 if (prompt_field_ && prompt_field_->HasFocus()) | 144 if (prompt_field_ && prompt_field_->HasFocus()) |
| 146 return false; | 145 return false; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 if (checkbox_) { | 272 if (checkbox_) { |
| 274 layout->AddPaddingRow(0, inter_row_vertical_spacing_); | 273 layout->AddPaddingRow(0, inter_row_vertical_spacing_); |
| 275 layout->StartRow(0, checkbox_column_view_set_id); | 274 layout->StartRow(0, checkbox_column_view_set_id); |
| 276 layout->AddView(checkbox_); | 275 layout->AddView(checkbox_); |
| 277 } | 276 } |
| 278 | 277 |
| 279 layout->AddPaddingRow(0, inter_row_vertical_spacing_); | 278 layout->AddPaddingRow(0, inter_row_vertical_spacing_); |
| 280 } | 279 } |
| 281 | 280 |
| 282 } // namespace views | 281 } // namespace views |
| OLD | NEW |