| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW); | 288 static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW); |
| 289 return text_cursor ? ibeam : arrow; | 289 return text_cursor ? ibeam : arrow; |
| 290 #else | 290 #else |
| 291 return text_cursor ? gfx::GetCursor(GDK_XTERM) : NULL; | 291 return text_cursor ? gfx::GetCursor(GDK_XTERM) : NULL; |
| 292 #endif | 292 #endif |
| 293 } | 293 } |
| 294 | 294 |
| 295 ///////////////////////////////////////////////////////////////// | 295 ///////////////////////////////////////////////////////////////// |
| 296 // NativeTextfieldViews, ContextMenuController overrides: | 296 // NativeTextfieldViews, ContextMenuController overrides: |
| 297 void NativeTextfieldViews::ShowContextMenuForView(View* source, | 297 void NativeTextfieldViews::ShowContextMenuForView(View* source, |
| 298 const gfx::Point& p, | 298 const gfx::Point& point) { |
| 299 bool is_mouse_gesture) { | |
| 300 UpdateContextMenu(); | 299 UpdateContextMenu(); |
| 301 if (context_menu_runner_->RunMenuAt( | 300 if (context_menu_runner_->RunMenuAt(GetWidget(), NULL, |
| 302 GetWidget(), NULL, gfx::Rect(p, gfx::Size()), | 301 gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT, |
| 303 views::MenuItemView::TOPLEFT, MenuRunner::HAS_MNEMONICS) == | 302 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) |
| 304 MenuRunner::MENU_DELETED) | |
| 305 return; | 303 return; |
| 306 } | 304 } |
| 307 | 305 |
| 308 ///////////////////////////////////////////////////////////////// | 306 ///////////////////////////////////////////////////////////////// |
| 309 // NativeTextfieldViews, views::DragController overrides: | 307 // NativeTextfieldViews, views::DragController overrides: |
| 310 void NativeTextfieldViews::WriteDragDataForView(views::View* sender, | 308 void NativeTextfieldViews::WriteDragDataForView(views::View* sender, |
| 311 const gfx::Point& press_pt, | 309 const gfx::Point& press_pt, |
| 312 OSExchangeData* data) { | 310 OSExchangeData* data) { |
| 313 DCHECK_NE(ui::DragDropTypes::DRAG_NONE, | 311 DCHECK_NE(ui::DragDropTypes::DRAG_NONE, |
| 314 GetDragOperationsForView(sender, press_pt)); | 312 GetDragOperationsForView(sender, press_pt)); |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 | 1137 |
| 1140 #if defined(USE_AURA) | 1138 #if defined(USE_AURA) |
| 1141 // static | 1139 // static |
| 1142 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1140 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 1143 Textfield* field) { | 1141 Textfield* field) { |
| 1144 return new NativeTextfieldViews(field); | 1142 return new NativeTextfieldViews(field); |
| 1145 } | 1143 } |
| 1146 #endif | 1144 #endif |
| 1147 | 1145 |
| 1148 } // namespace views | 1146 } // namespace views |
| OLD | NEW |