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

Unified Diff: chrome/browser/ui/panels/panel_window_controller_cocoa.mm

Issue 8393014: Hack to fix Panel focus issues on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_window_controller_cocoa.mm
diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
index 036ed821ff7b131bc87f291f6ed90073353b262d..238ec2f8b8e08b64e04cb1cb840575cd0a418c86 100644
--- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
@@ -188,6 +188,17 @@ enum {
// Shows the window without making it key, on top of its layer, even if
// Chromium is not an active app.
[window orderFrontRegardless];
+ // TODO(dcheng): Temporary hack to work around the fact that
+ // orderFrontRegardless causes us to become the first responder. The usual
+ // Chrome assumption is that becoming the first responder = you have focus, so
+ // we always deactivate the controls here. If we're created as an active
+ // panel, we'll get a NSWindowDidBecomeKeyNotification and reactivate the web
+ // view properly. See crbug.com/97831 for more details.
+ TabContents* tab_contents =
+ windowShim_->panel()->browser()->GetSelectedTabContents();
+ // RWHV may be NULL in unit tests.
+ if (tab_contents && tab_contents->GetRenderWidgetHostView())
+ tab_contents->GetRenderWidgetHostView()->SetActive(false);
[window setFrame:frame display:YES animate:YES];
[contentView setAutoresizesSubviews:YES];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698