Allow embedders to provide their own ContentClient subclass
This commit is contained in:
parent
c27ac79969
commit
3b879a6178
2 changed files with 9 additions and 2 deletions
|
@ -12,14 +12,18 @@
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
MainDelegate::MainDelegate()
|
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) {
|
bool MainDelegate::BasicStartupComplete(int* exit_code) {
|
||||||
|
content_client_ = CreateContentClient().Pass();
|
||||||
SetContentClient(content_client_.get());
|
SetContentClient(content_client_.get());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@ public:
|
||||||
~MainDelegate();
|
~MainDelegate();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Subclasses can override this to provide their own ContentClient implementation.
|
||||||
|
virtual scoped_ptr<ContentClient> CreateContentClient();
|
||||||
|
|
||||||
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
|
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
|
||||||
virtual void PreSandboxStartup() OVERRIDE;
|
virtual void PreSandboxStartup() OVERRIDE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue