diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:16:26 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:16:26 +0000 |
commit | 5be7da24155466bf0e9bf2e5fda1a581e549df8d (patch) | |
tree | e14153b1254d3eacaaa65a9997d7edf9775d4036 /views | |
parent | 8a92555e667090d8c6592ebe670628ca33b86ef0 (diff) | |
download | chromium_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 'views')
-rw-r--r-- | views/focus/focus_util_win.cc | 4 | ||||
-rw-r--r-- | views/widget/widget_gtk.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/views/focus/focus_util_win.cc b/views/focus/focus_util_win.cc index 046df70..2490528 100644 --- a/views/focus/focus_util_win.cc +++ b/views/focus/focus_util_win.cc @@ -6,6 +6,7 @@ #include <windowsx.h> +#include "base/auto_reset.h" #include "base/win_util.h" namespace views { @@ -102,9 +103,8 @@ bool RerouteMouseWheel(HWND window, WPARAM w_param, LPARAM l_param) { // window_under_wheel is a Chrome window. If allowed, redirect. if (IsCompatibleWithMouseWheelRedirection(window_under_wheel)) { - recursion_break = true; + AutoReset auto_reset_recursion_break(&recursion_break, true); SendMessage(window_under_wheel, WM_MOUSEWHEEL, w_param, l_param); - recursion_break = false; return true; } // If redirection is disallowed, try the parent. diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 87fdb8d..26e8ddf 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -8,6 +8,7 @@ #include "app/gfx/path.h" #include "app/os_exchange_data.h" #include "app/os_exchange_data_provider_gtk.h" +#include "base/auto_reset.h" #include "base/compiler_specific.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -464,9 +465,8 @@ void WidgetGtk::PaintNow(const gfx::Rect& update_rect) { gtk_widget_queue_draw_area(widget_, update_rect.x(), update_rect.y(), update_rect.width(), update_rect.height()); // Force the paint to occur now. - in_paint_now_ = true; + AutoReset auto_reset_in_paint_now(&in_paint_now_, true); gdk_window_process_updates(widget_->window, true); - in_paint_now_ = false; } } |