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

Side by Side Diff: ui/views/controls/textfield/native_textfield_views.cc

Issue 10916180: Context menus on view elements should be positioned above the finger when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar.cc ('k') | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698