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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 187483005: Extending the Views-on-Mac experiment: whole app list grid. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: still compiles r263560 + crrev/195793005 Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/native/native_view_host_mac.mm ('k') | ui/views/drag_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index c46ddd24b6d8b7bc5236e7e5fd83758772cb13ed..6633730a60184c171af172a96f3f998faa828bf9 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -18,6 +18,7 @@
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/cursor.h"
#include "ui/gfx/display.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/screen.h"
@@ -490,9 +491,13 @@ gfx::NativeCursor Textfield::GetCursor(const ui::MouseEvent& event) {
bool in_selection = GetRenderText()->IsPointInSelection(event.location());
bool drag_event = event.type() == ui::ET_MOUSE_DRAGGED;
bool text_cursor = !initiating_drag_ && (drag_event || !in_selection);
+#if defined(OS_MACOSX)
+ return text_cursor ? gfx::GetNativeIBeamCursor()
+ : gfx::GetNativeArrowCursor();
+#else
return text_cursor ? ui::kCursorIBeam : ui::kCursorNull;
+#endif
}
-
bool Textfield::OnMousePressed(const ui::MouseEvent& event) {
TrackMouseClicks(event);
@@ -920,7 +925,7 @@ void Textfield::ShowContextMenuForView(View* source,
ui::MenuSourceType source_type) {
UpdateContextMenu();
ignore_result(context_menu_runner_->RunMenuAt(GetWidget(), NULL,
- gfx::Rect(point, gfx::Size()), MenuItemView::TOPLEFT, source_type,
+ gfx::Rect(point, gfx::Size()), ui::TOPLEFT_MENU_ANCHOR, source_type,
MenuRunner::HAS_MNEMONICS | MenuRunner::CONTEXT_MENU));
}
@@ -1290,7 +1295,7 @@ gfx::NativeWindow Textfield::GetAttachedWindow() const {
// IME may want to interact with the native view of [NativeWidget A] rather
// than that of [NativeWidget B]. This is why we need to call
// GetTopLevelWidget() here.
- return GetWidget()->GetTopLevelWidget()->GetNativeView();
+ return GetWidget()->GetTopLevelWidget()->GetNativeWindow();
}
ui::TextInputType Textfield::GetTextInputType() const {
« no previous file with comments | « ui/views/controls/native/native_view_host_mac.mm ('k') | ui/views/drag_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698