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

Unified Diff: views/focus/focus_manager.cc

Issue 7706003: Fixes regression (and crash) in instant. The crash would happen if (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial field Created 9 years, 4 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 | « views/focus/focus_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/focus_manager.cc
diff --git a/views/focus/focus_manager.cc b/views/focus/focus_manager.cc
index 2dff171f1a0a9bd9199ffd9c5f7f9745491d60f2..4cdc5ae2d18ede93ae59ada1a6b9fd81ee71c3ce 100644
--- a/views/focus/focus_manager.cc
+++ b/views/focus/focus_manager.cc
@@ -12,6 +12,7 @@
#include <gtk/gtk.h>
#endif
+#include "base/auto_reset.h"
#include "base/logging.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "views/accelerator.h"
@@ -61,7 +62,8 @@ FocusManager::WidgetFocusManager::GetInstance() {
FocusManager::FocusManager(Widget* widget)
: widget_(widget),
focused_view_(NULL),
- focus_change_reason_(kReasonDirectFocusChange) {
+ focus_change_reason_(kReasonDirectFocusChange),
+ is_changing_focus_(false) {
DCHECK(widget_);
stored_focused_view_storage_id_ =
ViewStorage::GetInstance()->CreateStorageID();
@@ -270,6 +272,7 @@ void FocusManager::SetFocusedViewWithReason(
if (focused_view_ == view)
return;
+ AutoReset<bool> auto_changing_focus(&is_changing_focus_, true);
// Update the reason for the focus change (since this is checked by
// some listeners), then notify all listeners.
focus_change_reason_ = reason;
« no previous file with comments | « views/focus/focus_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698