Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_content_state.cc

Issue 2615663002: Fix MediaClient::RequestCaptureState(). (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" 5 #include "chrome/browser/ui/ash/chrome_shell_content_state.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/profiles/profile_manager.h" 8 #include "chrome/browser/profiles/profile_manager.h"
9 #include "components/user_manager/user_manager.h" 9 #include "components/user_manager/user_manager.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
11 11
12 ChromeShellContentState::ChromeShellContentState() {} 12 namespace {
13 ChromeShellContentState::~ChromeShellContentState() {} 13
14 ChromeShellContentState* g_instance = nullptr;
15
16 } // namespace
17
18 // static
19 ChromeShellContentState* ChromeShellContentState::GetInstance() {
20 DCHECK(g_instance);
21 return g_instance;
22 }
23
24 ChromeShellContentState::ChromeShellContentState() {
25 DCHECK(!g_instance);
26 g_instance = this;
27 }
28
29 ChromeShellContentState::~ChromeShellContentState() {
30 DCHECK_EQ(this, g_instance);
31 g_instance = nullptr;
32 }
14 33
15 content::BrowserContext* ChromeShellContentState::GetActiveBrowserContext() { 34 content::BrowserContext* ChromeShellContentState::GetActiveBrowserContext() {
16 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size()); 35 DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size());
17 return ProfileManager::GetActiveUserProfile(); 36 return ProfileManager::GetActiveUserProfile();
18 } 37 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_content_state.h ('k') | chrome/browser/ui/ash/chrome_shell_content_state_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698