| 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/textfield/native_textfield_views.h" | 5 #include "ui/views/controls/textfield/native_textfield_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 #endif | 307 #endif |
| 308 } | 308 } |
| 309 | 309 |
| 310 ///////////////////////////////////////////////////////////////// | 310 ///////////////////////////////////////////////////////////////// |
| 311 // NativeTextfieldViews, ContextMenuController overrides: | 311 // NativeTextfieldViews, ContextMenuController overrides: |
| 312 void NativeTextfieldViews::ShowContextMenuForView(View* source, | 312 void NativeTextfieldViews::ShowContextMenuForView(View* source, |
| 313 const gfx::Point& point) { | 313 const gfx::Point& point) { |
| 314 UpdateContextMenu(); | 314 UpdateContextMenu(); |
| 315 if (context_menu_runner_->RunMenuAt(GetWidget(), NULL, | 315 if (context_menu_runner_->RunMenuAt(GetWidget(), NULL, |
| 316 gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT, | 316 gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT, |
| 317 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) | 317 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
| 318 MenuRunner::MENU_DELETED) |
| 318 return; | 319 return; |
| 319 } | 320 } |
| 320 | 321 |
| 321 ///////////////////////////////////////////////////////////////// | 322 ///////////////////////////////////////////////////////////////// |
| 322 // NativeTextfieldViews, views::DragController overrides: | 323 // NativeTextfieldViews, views::DragController overrides: |
| 323 void NativeTextfieldViews::WriteDragDataForView(views::View* sender, | 324 void NativeTextfieldViews::WriteDragDataForView(views::View* sender, |
| 324 const gfx::Point& press_pt, | 325 const gfx::Point& press_pt, |
| 325 OSExchangeData* data) { | 326 OSExchangeData* data) { |
| 326 DCHECK_NE(ui::DragDropTypes::DRAG_NONE, | 327 DCHECK_NE(ui::DragDropTypes::DRAG_NONE, |
| 327 GetDragOperationsForView(sender, press_pt)); | 328 GetDragOperationsForView(sender, press_pt)); |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 // Filter out all control characters, including tab and new line characters, | 1219 // Filter out all control characters, including tab and new line characters, |
| 1219 // and all characters with Alt modifier. But we need to allow characters with | 1220 // and all characters with Alt modifier. But we need to allow characters with |
| 1220 // AltGr modifier. | 1221 // AltGr modifier. |
| 1221 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different | 1222 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different |
| 1222 // flag that we don't care about. | 1223 // flag that we don't care about. |
| 1223 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && | 1224 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && |
| 1224 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; | 1225 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; |
| 1225 } | 1226 } |
| 1226 | 1227 |
| 1227 } // namespace views | 1228 } // namespace views |
| OLD | NEW |