Allow embedders to provide their own ContentClient subclass

This commit is contained in:
Adam Roben 2013-04-24 18:30:47 -04:00
parent c27ac79969
commit 3b879a6178
2 changed files with 9 additions and 2 deletions

View file

@ -12,14 +12,18 @@
namespace brightray {
MainDelegate::MainDelegate()
: content_client_(new ContentClient) {
MainDelegate::MainDelegate() {
}
MainDelegate::~MainDelegate() {
}
scoped_ptr<ContentClient> MainDelegate::CreateContentClient() {
return make_scoped_ptr(new ContentClient).Pass();
}
bool MainDelegate::BasicStartupComplete(int* exit_code) {
content_client_ = CreateContentClient().Pass();
SetContentClient(content_client_.get());
return false;
}

View file

@ -19,6 +19,9 @@ public:
~MainDelegate();
protected:
// Subclasses can override this to provide their own ContentClient implementation.
virtual scoped_ptr<ContentClient> CreateContentClient();
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
virtual void PreSandboxStartup() OVERRIDE;