summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 23:16:26 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 23:16:26 +0000
commit5be7da24155466bf0e9bf2e5fda1a581e549df8d (patch)
treee14153b1254d3eacaaa65a9997d7edf9775d4036 /chrome/browser/autocomplete/autocomplete_edit_view_win.cc
parent8a92555e667090d8c6592ebe670628ca33b86ef0 (diff)
downloadchromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.zip
chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.tar.gz
chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.tar.bz2
Use AutoReset (formerly ScopedBool) where possible.
This frequently saves a tiny bit of code, but even when it doesn't I think it's more future-proof (less error-prone). BUG=none TEST=none Review URL: http://codereview.chromium.org/399096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_edit_view_win.cc')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index d30a8af..68fb78f 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -14,6 +14,7 @@
#include "app/os_exchange_data.h"
#include "app/os_exchange_data_provider_win.h"
#include "app/win_util.h"
+#include "base/auto_reset.h"
#include "base/base_drag_source.h"
#include "base/base_drop_target.h"
#include "base/basictypes.h"
@@ -2335,7 +2336,7 @@ void AutocompleteEditViewWin::StartDragIfNecessary(const CPoint& point) {
scoped_refptr<BaseDragSource> drag_source(new BaseDragSource);
DWORD dropped_mode;
- in_drag_ = true;
+ AutoReset auto_reset_in_drag(&in_drag_, true);
if (DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source,
supported_modes, &dropped_mode) == DRAGDROP_S_DROP) {
if ((dropped_mode == DROPEFFECT_MOVE) && (start_text == GetText())) {
@@ -2373,7 +2374,6 @@ void AutocompleteEditViewWin::StartDragIfNecessary(const CPoint& point) {
(GetKeyState(VK_RBUTTON) != 0)));
}
- in_drag_ = false;
initiated_drag_ = true;
tracking_click_ = false;
}