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

Unified Diff: ui/views/corewm/focus_controller.cc

Issue 13896011: Make javascript dialogs into top-level windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments. Created 7 years, 8 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 | « chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/focus_controller.cc
diff --git a/ui/views/corewm/focus_controller.cc b/ui/views/corewm/focus_controller.cc
index eaab15101820708b88242137c2ffe4cd836e7915..90500d58f61101e6e265f30848bddeeb85dee97e 100644
--- a/ui/views/corewm/focus_controller.cc
+++ b/ui/views/corewm/focus_controller.cc
@@ -253,7 +253,14 @@ void FocusController::OnWindowHierarchyChanged(
void FocusController::SetFocusedWindow(aura::Window* window) {
if (updating_focus_ || window == focused_window_)
return;
- DCHECK(rules_->CanFocusWindow(window));
+
+ // When a modal dialog appears, SetFocusedWindow gets called by
+ // ClearNativeFocus for the previously active window as it is deactivated. In
+ // this case, CanFocusWindow returns false and this method has no further
+ // work to do.
+ if (!rules_->CanFocusWindow(window))
Ben Goodger (Google) 2013/04/25 17:19:28 I'm not happy with this. I've made it thus far tha
robertshield 2013/04/26 18:40:42 I reverted this bit and instead now perform a chec
+ return;
+
if (window)
DCHECK_EQ(window, rules_->GetFocusableWindow(window));
« no previous file with comments | « chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698