Index: chrome/browser/ui/ash/chrome_shell_content_state.cc |
diff --git a/chrome/browser/ui/ash/chrome_shell_content_state.cc b/chrome/browser/ui/ash/chrome_shell_content_state.cc |
index 4de2fe820ffdc90203871ca1d4423510ff36cd99..6d8ecb1c3172f11359d3668cfffacb6b0e247999 100644 |
--- a/chrome/browser/ui/ash/chrome_shell_content_state.cc |
+++ b/chrome/browser/ui/ash/chrome_shell_content_state.cc |
@@ -9,8 +9,27 @@ |
#include "components/user_manager/user_manager.h" |
#include "content/public/browser/browser_context.h" |
-ChromeShellContentState::ChromeShellContentState() {} |
-ChromeShellContentState::~ChromeShellContentState() {} |
+namespace { |
+ |
+ChromeShellContentState* g_instance = nullptr; |
+ |
+} // namespace |
+ |
+// static |
+ChromeShellContentState* ChromeShellContentState::GetInstance() { |
+ DCHECK(g_instance); |
+ return g_instance; |
+} |
+ |
+ChromeShellContentState::ChromeShellContentState() { |
+ DCHECK(!g_instance); |
+ g_instance = this; |
+} |
+ |
+ChromeShellContentState::~ChromeShellContentState() { |
+ DCHECK_EQ(this, g_instance); |
+ g_instance = nullptr; |
+} |
content::BrowserContext* ChromeShellContentState::GetActiveBrowserContext() { |
DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); |