OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_finder.h" | 5 #include "chrome/browser/ui/browser_finder.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser_iterator.h" | 8 #include "chrome/browser/ui/browser_iterator.h" |
9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 // MultiUserWindowManager might be NULL under test scenario. | 53 // MultiUserWindowManager might be NULL under test scenario. |
54 chrome::MultiUserWindowManager* const window_manager = | 54 chrome::MultiUserWindowManager* const window_manager = |
55 chrome::MultiUserWindowManager::GetInstance(); | 55 chrome::MultiUserWindowManager::GetInstance(); |
56 if (window_manager) { | 56 if (window_manager) { |
57 const std::string& shown_user_id = window_manager->GetUserPresentingWindow( | 57 const std::string& shown_user_id = window_manager->GetUserPresentingWindow( |
58 browser->window()->GetNativeWindow()); | 58 browser->window()->GetNativeWindow()); |
59 Profile* shown_profile = | 59 Profile* shown_profile = |
60 shown_user_id.empty() | 60 shown_user_id.empty() |
61 ? nullptr | 61 ? nullptr |
62 : multi_user_util::GetProfileFromUserID(shown_user_id); | 62 : multi_user_util::GetProfileFromUserID(shown_user_id); |
63 matches_profile &= !shown_profile || shown_profile == profile; | 63 matches_profile &= !shown_profile || |
64 shown_profile == profile->GetOriginalProfile(); | |
msw
2015/06/23 17:08:51
Should you use shown_profile->GetOriginalProfile()
msw
2015/06/23 17:08:51
Should this change be limited to when kMatchOrigin
xdai1
2015/06/30 16:16:49
Sorry my fault. Should compare with original profi
| |
64 } | 65 } |
65 #endif | 66 #endif |
66 | 67 |
67 if (match_types & kMatchOriginalProfile) { | 68 if (match_types & kMatchOriginalProfile) { |
68 if (browser->profile()->GetOriginalProfile() != | 69 if (browser->profile()->GetOriginalProfile() != |
69 profile->GetOriginalProfile()) | 70 profile->GetOriginalProfile()) |
70 return false; | 71 return false; |
71 } else if (!matches_profile) { | 72 } else if (!matches_profile) { |
72 return false; | 73 return false; |
73 } | 74 } |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 | 225 |
225 size_t GetBrowserCount(Profile* profile, HostDesktopType type) { | 226 size_t GetBrowserCount(Profile* profile, HostDesktopType type) { |
226 return GetBrowserCountImpl(profile, type, kMatchAny); | 227 return GetBrowserCountImpl(profile, type, kMatchAny); |
227 } | 228 } |
228 | 229 |
229 size_t GetTabbedBrowserCount(Profile* profile, HostDesktopType type) { | 230 size_t GetTabbedBrowserCount(Profile* profile, HostDesktopType type) { |
230 return GetBrowserCountImpl(profile, type, kMatchTabbed); | 231 return GetBrowserCountImpl(profile, type, kMatchTabbed); |
231 } | 232 } |
232 | 233 |
233 } // namespace chrome | 234 } // namespace chrome |
OLD | NEW |