OLD | NEW |
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 "ash/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
10 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 10 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
11 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 11 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
12 #include "components/signin/core/account_id/account_id.h" | 12 #include "components/signin/core/account_id/account_id.h" |
13 #include "components/user_manager/user_manager.h" | 13 #include "components/user_manager/user_manager.h" |
14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
15 | 15 |
16 content::BrowserContext* ChromeShellContentState::GetBrowserContextByIndex( | 16 content::BrowserContext* ChromeShellContentState::GetBrowserContextByIndex( |
17 ash::UserIndex index) { | 17 ash::UserIndex index) { |
(...skipping 18 matching lines...) Expand all Loading... |
36 content::BrowserContext* | 36 content::BrowserContext* |
37 ChromeShellContentState::GetUserPresentingBrowserContextForWindow( | 37 ChromeShellContentState::GetUserPresentingBrowserContextForWindow( |
38 aura::Window* window) { | 38 aura::Window* window) { |
39 const AccountId& account_id = | 39 const AccountId& account_id = |
40 chrome::MultiUserWindowManager::GetInstance()->GetUserPresentingWindow( | 40 chrome::MultiUserWindowManager::GetInstance()->GetUserPresentingWindow( |
41 window); | 41 window); |
42 return account_id.is_valid() | 42 return account_id.is_valid() |
43 ? multi_user_util::GetProfileFromAccountId(account_id) | 43 ? multi_user_util::GetProfileFromAccountId(account_id) |
44 : nullptr; | 44 : nullptr; |
45 } | 45 } |
OLD | NEW |