Commit cb363e70 authored by oshima@chromium.org's avatar oshima@chromium.org

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
parent dc4a0bba
......@@ -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>();
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment