| 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/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // We only accepts Ctrl-C. | 136 // We only accepts Ctrl-C. |
| 137 DCHECK(accelerator.key_code() == 'C' && accelerator.IsCtrlDown()); | 137 DCHECK(accelerator.key_code() == 'C' && accelerator.IsCtrlDown()); |
| 138 | 138 |
| 139 // We must not intercept Ctrl-C when we have a text box and it's focused. | 139 // We must not intercept Ctrl-C when we have a text box and it's focused. |
| 140 if (prompt_field_ && prompt_field_->HasFocus()) | 140 if (prompt_field_ && prompt_field_->HasFocus()) |
| 141 return false; | 141 return false; |
| 142 | 142 |
| 143 if (!ViewsDelegate::views_delegate) | 143 if (!ViewsDelegate::views_delegate) |
| 144 return false; | 144 return false; |
| 145 | 145 |
| 146 ui::Clipboard* clipboard = ViewsDelegate::views_delegate->GetClipboard(); | 146 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); |
| 147 if (!clipboard) | 147 if (!clipboard) |
| 148 return false; | 148 return false; |
| 149 | 149 |
| 150 ui::ScopedClipboardWriter scw(clipboard, ui::Clipboard::BUFFER_STANDARD); | 150 ui::ScopedClipboardWriter scw(clipboard, ui::Clipboard::BUFFER_STANDARD); |
| 151 string16 text = message_labels_[0]->text(); | 151 string16 text = message_labels_[0]->text(); |
| 152 for (size_t i = 1; i < message_labels_.size(); ++i) | 152 for (size_t i = 1; i < message_labels_.size(); ++i) |
| 153 text += message_labels_[i]->text(); | 153 text += message_labels_[i]->text(); |
| 154 scw.WriteText(text); | 154 scw.WriteText(text); |
| 155 return true; | 155 return true; |
| 156 } | 156 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (checkbox_) { | 261 if (checkbox_) { |
| 262 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 262 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 263 layout->StartRow(0, checkbox_column_view_set_id); | 263 layout->StartRow(0, checkbox_column_view_set_id); |
| 264 layout->AddView(checkbox_); | 264 layout->AddView(checkbox_); |
| 265 } | 265 } |
| 266 | 266 |
| 267 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 267 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace views | 270 } // namespace views |
| OLD | NEW |