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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 10332197: SelectAll when activating the omni box via touch. Regular (short) touch should now work the same wa… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: whitespace fixes Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index 982dd7f4ea7ec9b3105d200a0a6adf0473dbb810..88b909fd8876fa365fa9b411fb647cdb6738c719 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -58,6 +58,15 @@
#include "ui/views/controls/textfield/native_textfield_win.h"
#include "ui/views/widget/widget.h"
+// TODO(tommi): Remove this when we update to a newer SDK.
Peter Kasting 2012/05/16 18:30:16 Just curious: Is there a bug or specific plan on u
tommi (sloooow) - chröme 2012/05/16 19:11:08 I don't know if there is a bug filed, but we're al
Peter Kasting 2012/05/16 19:12:34 That'd be fine. Whatever you think is best. I mo
+#ifndef POINTER_MESSAGE_FLAG_FIRSTBUTTON
+#define POINTER_MESSAGE_FLAG_FIRSTBUTTON 0x00000010 // Primary action
+#define IS_POINTER_FLAG_SET_WPARAM(wParam, flag) \
+ (((DWORD)HIWORD(wParam) & (flag)) == (flag))
+#define IS_POINTER_FIRSTBUTTON_WPARAM(wParam) \
+ IS_POINTER_FLAG_SET_WPARAM(wParam, POINTER_MESSAGE_FLAG_FIRSTBUTTON)
+#endif
+
#pragma comment(lib, "oleacc.lib") // Needed for accessibility support.
#pragma comment(lib, "riched20.lib") // Needed for the richedit control.
@@ -1447,6 +1456,12 @@ LRESULT OmniboxViewWin::OnPointerDown(UINT message,
WPARAM wparam,
LPARAM lparam) {
SetFocus();
+
+ if (IS_POINTER_FIRSTBUTTON_WPARAM(wparam)) {
+ TrackMousePosition(kLeft, CPoint(GET_X_LPARAM(lparam),
+ GET_Y_LPARAM(lparam)));
+ }
+
// ITextInputPanel is not supported on all platforms. NULL is fine.
if (keyboard_ != NULL)
keyboard_->SetInPlaceVisibility(true);
@@ -1663,9 +1678,10 @@ LRESULT OmniboxViewWin::OnMouseActivate(HWND window,
// reached before OnXButtonDown(), preventing us from detecting this properly
// there. Also in those cases, we need to already know in OnSetFocus() that
// we should not restore the saved selection.
- if (!model_->has_focus() &&
- ((mouse_message == WM_LBUTTONDOWN || mouse_message == WM_RBUTTONDOWN)) &&
- (result == MA_ACTIVATE)) {
+ if (result == MA_ACTIVATE &&
Peter Kasting 2012/05/16 18:30:16 Nit: For consistency with the rest of this file, k
tommi (sloooow) - chröme 2012/05/16 19:11:08 Done
+ (mouse_message == WM_LBUTTONDOWN || mouse_message == WM_RBUTTONDOWN ||
+ mouse_message == WM_POINTERDOWN) &&
+ !model_->has_focus()) {
DCHECK(!gaining_focus_.get());
gaining_focus_.reset(new ScopedFreeze(this, GetTextObjectModel()));
// NOTE: Despite |mouse_message| being WM_XBUTTONDOWN here, we're not
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698