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

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

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
Index: extensions/shell/browser/shell_app_delegate.h
diff --git a/extensions/shell/browser/shell_app_delegate.h b/extensions/shell/browser/shell_app_delegate.h
index ecf48485d79512356ef2013f28b4d3ed7256f433..8c9be2e83af985f75c7d06277e3133edecf9863d 100644
--- a/extensions/shell/browser/shell_app_delegate.h
+++ b/extensions/shell/browser/shell_app_delegate.h
@@ -6,11 +6,14 @@
#define EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_
#include "extensions/browser/app_window/app_delegate.h"
+#include "content/public/browser/web_contents_observer.h"
namespace extensions {
-// app_shell's AppDelegate implementation.
-class ShellAppDelegate : public AppDelegate {
+// AppDelegate implementation for app_shell. Sets focus after the WebContents is
+// created. Ignores most operations that would create a new dialog or window.
+class ShellAppDelegate : public AppDelegate,
+ public content::WebContentsObserver {
public:
ShellAppDelegate();
~ShellAppDelegate() override;
@@ -48,6 +51,9 @@ class ShellAppDelegate : public AppDelegate {
bool IsWebContentsVisible(content::WebContents* web_contents) override;
void SetTerminatingCallback(const base::Closure& callback) override;
+ // content::WebContentsObserver:
+ void RenderViewCreated(content::RenderViewHost* render_view_host) override;
+
private:
DISALLOW_COPY_AND_ASSIGN(ShellAppDelegate);
};
« no previous file with comments | « no previous file | extensions/shell/browser/shell_app_delegate.cc » ('j') | extensions/shell/browser/shell_app_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698