Index: chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm |
index e97e22f80dde1527c9add4851f5b00d0f024070c..f102394bfe8c2b80f02ab59920280a07a45d13b8 100644 |
--- a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm |
@@ -13,6 +13,8 @@ |
#include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
#include "chrome/common/extensions/extension.h" |
#include "content/public/browser/native_web_keyboard_event.h" |
+#include "content/public/browser/notification_source.h" |
+#include "content/public/browser/notification_types.h" |
#include "content/public/browser/render_widget_host_view.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_view.h" |
@@ -262,6 +264,9 @@ NativeAppWindowCocoa::NativeAppWindowCocoa( |
window, |
extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
shell_window)); |
+ registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, |
+ content::Source<content::NavigationController>( |
+ &web_contents()->GetController())); |
} |
void NativeAppWindowCocoa::InstallView() { |
@@ -638,6 +643,19 @@ void NativeAppWindowCocoa::InstallDraggableRegionViews() { |
} |
} |
+void NativeAppWindowCocoa::Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) { |
Avi (use Gerrit)
2013/01/14 17:10:03
bad indentation
|
+ if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { |
+ if (content::RenderWidgetHostView* rwhv = |
+ web_contents()->GetRenderWidgetHostView()) { |
+ rwhv->Focus(); |
Avi (use Gerrit)
2013/01/14 17:10:03
I'm not clear on why this wouldn't be working. Is
jeremya
2013/01/15 05:49:52
The bug happens even for non-frameless windows.
I
|
+ } |
+ return; |
+ } |
+ NOTREACHED(); |
+} |
+ |
void NativeAppWindowCocoa::FlashFrame(bool flash) { |
if (flash) { |
attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest]; |