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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_win.cc

Issue 6386009: Remove app/win/win_util.h,cc etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with NSApp changes in r73581 Created 9 years, 11 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 | « base/mac/mac_util_unittest.mm ('k') | chrome/browser/browser_main_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_win.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index cca0d08d2cea6113d943c90067f2ec8038cac25d..24a1be039b34b1549e2cf8339d6eaccd32ca6ed2 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -12,7 +12,6 @@
#include <textserv.h>
#include "app/win/iat_patch_function.h"
-#include "app/win/win_util.h"
#include "base/auto_reset.h"
#include "base/basictypes.h"
#include "base/i18n/rtl.h"
@@ -50,6 +49,7 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h"
+#include "views/controls/textfield/native_textfield_win.h"
#include "views/drag_utils.h"
#include "views/focus/focus_util_win.h"
#include "views/widget/widget.h"
@@ -261,6 +261,16 @@ struct AutocompleteEditState {
const AutocompleteEditViewWin::State view_state;
};
+// Returns true if the current point is far enough from the origin that it
+// would be considered a drag.
+bool IsDrag(const POINT& origin, const POINT& current) {
+ // The CXDRAG and CYDRAG system metrics describe the width and height of a
+ // rectangle around the origin position, inside of which motion is not
+ // considered a drag.
+ return (abs(current.x - origin.x) > (GetSystemMetrics(SM_CXDRAG) / 2)) ||
+ (abs(current.y - origin.y) > (GetSystemMetrics(SM_CYDRAG) / 2));
+}
+
} // namespace
///////////////////////////////////////////////////////////////////////////////
@@ -963,7 +973,7 @@ bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing(
// We don't process ALT + numpad digit as accelerators, they are used for
// entering special characters. We do translate alt-home.
if (e.IsAltDown() && (key != ui::VKEY_HOME) &&
- app::win::IsNumPadDigit(key, e.IsExtendedKey()))
+ views::NativeTextfieldWin::IsNumPadDigit(key, e.IsExtendedKey()))
return true;
// Skip accelerators for key combinations omnibox wants to crack. This list
@@ -1459,8 +1469,8 @@ void AutocompleteEditViewWin::OnLButtonDown(UINT keys, const CPoint& point) {
// double_click_time_ from the current message's time even if the timer has
// wrapped in between.
const bool is_triple_click = tracking_double_click_ &&
- app::win::IsDoubleClick(double_click_point_, point,
- GetCurrentMessage()->time - double_click_time_);
+ views::NativeTextfieldWin::IsDoubleClick(double_click_point_, point,
+ GetCurrentMessage()->time - double_click_time_);
tracking_double_click_ = false;
if (!gaining_focus_.get() && !is_triple_click)
@@ -1559,7 +1569,7 @@ void AutocompleteEditViewWin::OnMouseMove(UINT keys, const CPoint& point) {
return;
}
- if (tracking_click_[kLeft] && !app::win::IsDrag(click_point_[kLeft], point))
+ if (tracking_click_[kLeft] && !IsDrag(click_point_[kLeft], point))
return;
tracking_click_[kLeft] = false;
@@ -2380,7 +2390,7 @@ ITextDocument* AutocompleteEditViewWin::GetTextObjectModel() const {
}
void AutocompleteEditViewWin::StartDragIfNecessary(const CPoint& point) {
- if (initiated_drag_ || !app::win::IsDrag(click_point_[kLeft], point))
+ if (initiated_drag_ || !IsDrag(click_point_[kLeft], point))
return;
ui::OSExchangeData data;
@@ -2537,7 +2547,7 @@ void AutocompleteEditViewWin::SelectAllIfNecessary(MouseButton button,
const CPoint& point) {
// When the user has clicked and released to give us focus, select all.
if (tracking_click_[button] &&
- !app::win::IsDrag(click_point_[button], point)) {
+ !IsDrag(click_point_[button], point)) {
// Select all in the reverse direction so as not to scroll the caret
// into view and shift the contents jarringly.
SelectAll(true);
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | chrome/browser/browser_main_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698