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

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

Issue 231883003: [stash] 20140404-crbug-312961-mac-views-bridge-C-wholegrid Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 ba72a31e0c98948bc0533f85729758e01b2c7f60..223015f977338bc5b33675059b5902e490ee8b58 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"
@@ -489,9 +490,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);
@@ -919,7 +924,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));
}
@@ -1289,7 +1294,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