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

Unified Diff: extensions/shell/browser/shell_app_delegate.cc

Issue 754313003: app_shell: Fix focus on opening new app windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « extensions/shell/browser/shell_app_delegate.h ('k') | extensions/shell/browser/shell_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « extensions/shell/browser/shell_app_delegate.h ('k') | extensions/shell/browser/shell_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698