| Index: blimp/engine/app/blimp_content_main_delegate.cc
|
| diff --git a/blimp/engine/app/blimp_content_main_delegate.cc b/blimp/engine/app/blimp_content_main_delegate.cc
|
| index aa31459654ea1e93e9cc929792ffa99d5b036b68..eb36e03954ec3ee03292161cc0f1e8103754423a 100644
|
| --- a/blimp/engine/app/blimp_content_main_delegate.cc
|
| +++ b/blimp/engine/app/blimp_content_main_delegate.cc
|
| @@ -17,6 +17,9 @@
|
| namespace blimp {
|
| namespace engine {
|
| namespace {
|
| +
|
| +BlimpContentMainDelegate* g_content_main_delegate = nullptr;
|
| +
|
| void InitLogging() {
|
| // TODO(haibinlu): Remove this before release.
|
| // Enables a few verbose log by default.
|
| @@ -40,9 +43,20 @@ void InitLogging() {
|
| }
|
| } // namespace
|
|
|
| -BlimpContentMainDelegate::BlimpContentMainDelegate() {}
|
| +BlimpContentMainDelegate::BlimpContentMainDelegate() {
|
| + DCHECK(!g_content_main_delegate);
|
| + g_content_main_delegate = this;
|
| +}
|
|
|
| -BlimpContentMainDelegate::~BlimpContentMainDelegate() {}
|
| +BlimpContentMainDelegate::~BlimpContentMainDelegate() {
|
| + DCHECK_EQ(this, g_content_main_delegate);
|
| + g_content_main_delegate = nullptr;
|
| +}
|
| +
|
| +BlimpContentBrowserClient*
|
| +BlimpContentMainDelegate::GetBlimpContentBrowserClient() {
|
| + return browser_client_.get();
|
| +}
|
|
|
| bool BlimpContentMainDelegate::BasicStartupComplete(int* exit_code) {
|
| InitLogging();
|
| @@ -54,6 +68,11 @@ void BlimpContentMainDelegate::PreSandboxStartup() {
|
| InitializeResourceBundle();
|
| }
|
|
|
| +// static
|
| +BlimpContentMainDelegate* BlimpContentMainDelegate::GetInstanceForTesting() {
|
| + return g_content_main_delegate;
|
| +}
|
| +
|
| void BlimpContentMainDelegate::InitializeResourceBundle() {
|
| base::FilePath pak_file;
|
| bool pak_file_valid = PathService::Get(base::DIR_MODULE, &pak_file);
|
|
|