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

Unified Diff: chrome/browser/ui/views/frame/browser_frame_aura.cc

Issue 10908151: aura: Fix focus on web contents for popup windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't need check for initial show Created 8 years, 3 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/views/frame/browser_frame_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_frame_aura.cc
diff --git a/chrome/browser/ui/views/frame/browser_frame_aura.cc b/chrome/browser/ui/views/frame/browser_frame_aura.cc
index bbea5f0ef640f268efe02eb28664a4fb32d37a64..df46354179fc432e5163615eaf0f9dbdcc513e53 100644
--- a/chrome/browser/ui/views/frame/browser_frame_aura.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_aura.cc
@@ -138,6 +138,17 @@ void BrowserFrameAura::OnWindowDestroying() {
views::NativeWidgetAura::OnWindowDestroying();
}
+void BrowserFrameAura::OnWindowTargetVisibilityChanged(bool visible) {
+ // On Aura when the BrowserView is shown it tries to restore focus, but can
+ // be blocked when this parent BrowserFrameAura isn't visible. Therefore we
+ // RestoreFocus() when we become visible, which results in the web contents
+ // being asked to focus, which places focus either in the web contents or in
+ // the location bar as appropriate.
+ if (visible)
+ browser_view_->RestoreFocus();
+ views::NativeWidgetAura::OnWindowTargetVisibilityChanged(visible);
+}
+
////////////////////////////////////////////////////////////////////////////////
// BrowserFrameAura, NativeBrowserFrame implementation:
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698