summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-17 19:27:23 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-17 19:27:23 +0000
commitcb363e702cb70f99c707be975e57015b438eaef0 (patch)
tree986be4233aabdfcd68aecbd6b4b00cc4495b27d5
parentdc4a0bba1aa40a43a89994d32280c3e815b22b40 (diff)
downloadchromium_src-cb363e702cb70f99c707be975e57015b438eaef0.zip
chromium_src-cb363e702cb70f99c707be975e57015b438eaef0.tar.gz
chromium_src-cb363e702cb70f99c707be975e57015b438eaef0.tar.bz2
Hook up delegate interfaces so that athena can create its own WebContentsViewDelegate
This is necessary to handle context menu , popup menu etc. BUG=380438 Review URL: https://codereview.chromium.org/396813003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283839 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--apps/shell/app/shell_main_delegate.cc13
-rw-r--r--apps/shell/app/shell_main_delegate.h4
-rw-r--r--athena/main/athena_main.cc22
3 files changed, 29 insertions, 10 deletions
diff --git a/apps/shell/app/shell_main_delegate.cc b/apps/shell/app/shell_main_delegate.cc
index 7043498..2e98a1d 100644
--- a/apps/shell/app/shell_main_delegate.cc
+++ b/apps/shell/app/shell_main_delegate.cc
@@ -67,11 +67,16 @@ void ShellMainDelegate::PreSandboxStartup() {
}
content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
- browser_client_.reset(
- new apps::ShellContentBrowserClient(CreateShellBrowserMainDelegate()));
+ browser_client_.reset(CreateShellContentBrowserClient());
return browser_client_.get();
}
+content::ContentBrowserClient*
+ShellMainDelegate::CreateShellContentBrowserClient() {
+ return new apps::ShellContentBrowserClient(
+ new DefaultShellBrowserMainDelegate());
+}
+
content::ContentRendererClient*
ShellMainDelegate::CreateContentRendererClient() {
renderer_client_.reset(
@@ -79,10 +84,6 @@ ShellMainDelegate::CreateContentRendererClient() {
return renderer_client_.get();
}
-ShellBrowserMainDelegate* ShellMainDelegate::CreateShellBrowserMainDelegate() {
- return new DefaultShellBrowserMainDelegate();
-}
-
scoped_ptr<ShellRendererMainDelegate>
ShellMainDelegate::CreateShellRendererMainDelegate() {
return scoped_ptr<ShellRendererMainDelegate>();
diff --git a/apps/shell/app/shell_main_delegate.h b/apps/shell/app/shell_main_delegate.h
index 13a0e45..465f60e 100644
--- a/apps/shell/app/shell_main_delegate.h
+++ b/apps/shell/app/shell_main_delegate.h
@@ -33,8 +33,8 @@ class ShellMainDelegate : public content::ContentMainDelegate {
OVERRIDE;
protected:
- // The created object is owned by ShellBrowserMainParts.
- virtual ShellBrowserMainDelegate* CreateShellBrowserMainDelegate();
+ // The created object is owned by this object.
+ virtual content::ContentBrowserClient* CreateShellContentBrowserClient();
// The returned object is owned by ShellContentRendererClient.
virtual scoped_ptr<ShellRendererMainDelegate>
diff --git a/athena/main/athena_main.cc b/athena/main/athena_main.cc
index ab7f3a4..7ade3c9 100644
--- a/athena/main/athena_main.cc
+++ b/athena/main/athena_main.cc
@@ -4,6 +4,7 @@
#include "apps/shell/app/shell_main_delegate.h"
#include "apps/shell/browser/shell_browser_main_delegate.h"
+#include "apps/shell/browser/shell_content_browser_client.h"
#include "apps/shell/browser/shell_desktop_controller.h"
#include "apps/shell/browser/shell_extension_system.h"
#include "apps/shell/common/switches.h"
@@ -110,6 +111,23 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate {
DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate);
};
+class AthenaContentBrowserClient : public apps::ShellContentBrowserClient {
+ public:
+ AthenaContentBrowserClient()
+ : apps::ShellContentBrowserClient(new AthenaBrowserMainDelegate()) {}
+ virtual ~AthenaContentBrowserClient() {}
+
+ // content::ContentBrowserClient:
+ virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate(
+ content::WebContents* web_contents) OVERRIDE {
+ // TODO(oshima): Implement athena's WebContentsViewDelegate.
+ return NULL;
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AthenaContentBrowserClient);
+};
+
class AthenaRendererMainDelegate : public apps::ShellRendererMainDelegate {
public:
AthenaRendererMainDelegate() {}
@@ -133,9 +151,9 @@ class AthenaMainDelegate : public apps::ShellMainDelegate {
private:
// apps::ShellMainDelegate:
- virtual apps::ShellBrowserMainDelegate* CreateShellBrowserMainDelegate()
+ virtual content::ContentBrowserClient* CreateShellContentBrowserClient()
OVERRIDE {
- return new AthenaBrowserMainDelegate();
+ return new AthenaContentBrowserClient();
}
virtual scoped_ptr<apps::ShellRendererMainDelegate>