Chromium Code Reviews| 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 6e7b445ad4ca90bf93f68ddabc470db80543ed17..4e646ade8c898a1e7c4256b768ff528a0d3f3e4c 100644 |
| --- a/blimp/engine/app/blimp_content_main_delegate.cc |
| +++ b/blimp/engine/app/blimp_content_main_delegate.cc |
| @@ -31,6 +31,9 @@ base::LazyInstance<BlimpEngineCrashReporterClient> |
| g_blimp_engine_crash_reporter_client = LAZY_INSTANCE_INITIALIZER; |
| namespace { |
| + |
| +BlimpContentMainDelegate* g_content_main_delegate = nullptr; |
|
Kevin M
2016/05/05 20:28:51
I don't think we should be adding test-hook single
haibinlu
2016/05/05 22:41:36
Done.
|
| + |
| void InitLogging() { |
| // TODO(haibinlu): Remove this before release. |
| // Enables a few verbose log by default. |
| @@ -54,9 +57,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(); |
| @@ -77,6 +91,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); |