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

Side by Side Diff: chrome/browser/ui/browser_finder.cc

Issue 1198313003: Fix the browser match rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698