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

Side by Side Diff: views/controls/message_box_view.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 9 years, 1 month 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
« no previous file with comments | « views/controls/message_box_view.h ('k') | views/controls/tabbed_pane/tabbed_pane.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/controls/message_box_view.h" 5 #include "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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/accessibility/accessible_view_state.h" 10 #include "ui/base/accessibility/accessible_view_state.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 View* child) { 95 View* child) {
96 if (child == this && is_add) { 96 if (child == this && is_add) {
97 if (prompt_field_) 97 if (prompt_field_)
98 prompt_field_->SelectAll(); 98 prompt_field_->SelectAll();
99 99
100 GetWidget()->NotifyAccessibilityEvent( 100 GetWidget()->NotifyAccessibilityEvent(
101 this, ui::AccessibilityTypes::EVENT_ALERT, true); 101 this, ui::AccessibilityTypes::EVENT_ALERT, true);
102 } 102 }
103 } 103 }
104 104
105 bool MessageBoxView::AcceleratorPressed( 105 bool MessageBoxView::AcceleratorPressed(const ui::Accelerator& accelerator) {
106 const Accelerator& accelerator) {
107 // We only accepts Ctrl-C. 106 // We only accepts Ctrl-C.
108 DCHECK(accelerator.key_code() == 'C' && accelerator.IsCtrlDown()); 107 DCHECK(accelerator.key_code() == 'C' && accelerator.IsCtrlDown());
109 108
110 // We must not intercept Ctrl-C when we have a text box and it's focused. 109 // We must not intercept Ctrl-C when we have a text box and it's focused.
111 if (prompt_field_ && prompt_field_->HasFocus()) 110 if (prompt_field_ && prompt_field_->HasFocus())
112 return false; 111 return false;
113 112
114 if (!ViewsDelegate::views_delegate) 113 if (!ViewsDelegate::views_delegate)
115 return false; 114 return false;
116 115
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (checkbox_) { 218 if (checkbox_) {
220 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 219 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
221 layout->StartRow(0, checkbox_column_view_set_id); 220 layout->StartRow(0, checkbox_column_view_set_id);
222 layout->AddView(checkbox_); 221 layout->AddView(checkbox_);
223 } 222 }
224 223
225 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 224 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
226 } 225 }
227 226
228 } // namespace views 227 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/message_box_view.h ('k') | views/controls/tabbed_pane/tabbed_pane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698