Chromium Code Reviews| Index: extensions/shell/browser/shell_app_delegate.cc |
| diff --git a/extensions/shell/browser/shell_app_delegate.cc b/extensions/shell/browser/shell_app_delegate.cc |
| index cac8a917ec3548f5b0d487f91e39fa1eb82a448e..1e2d5ddb8d24637f0459ad04a7a21668c1ffc4f7 100644 |
| --- a/extensions/shell/browser/shell_app_delegate.cc |
| +++ b/extensions/shell/browser/shell_app_delegate.cc |
| @@ -4,6 +4,7 @@ |
| #include "extensions/shell/browser/shell_app_delegate.h" |
| +#include "content/public/browser/web_contents.h" |
| #include "extensions/common/constants.h" |
| #include "extensions/shell/browser/media_capture_util.h" |
| @@ -16,6 +17,7 @@ ShellAppDelegate::~ShellAppDelegate() { |
| } |
| void ShellAppDelegate::InitWebContents(content::WebContents* web_contents) { |
| + Observe(web_contents); |
|
oshima
2014/12/04 23:38:07
just a q: don't you have to stop observing ?
James Cook
2014/12/05 02:01:50
No, you don't, this is a common pattern. There is
|
| } |
| void ShellAppDelegate::ResizeWebContents(content::WebContents* web_contents, |
| @@ -92,4 +94,11 @@ void ShellAppDelegate::SetTerminatingCallback(const base::Closure& callback) { |
| NOTIMPLEMENTED(); |
| } |
| +void ShellAppDelegate::RenderViewCreated( |
| + content::RenderViewHost* render_view_host) { |
| + // The views implementation of AppWindow takes focus via SetInitialFocus() |
| + // and views::WebView but app_shell is aura-only and must do it manually. |
| + web_contents()->Focus(); |
| +} |
| + |
| } // namespace extensions |