OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabs/tab_finder.h" | 5 #include "chrome/browser/tabs/tab_finder.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "chrome/browser/history/history.h" | 9 #include "chrome/browser/history/history.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // See if the current browser has a tab matching the specified url. | 88 // See if the current browser has a tab matching the specified url. |
89 TabContents* tab_in_browser = FindTabInBrowser(browser, url); | 89 TabContents* tab_in_browser = FindTabInBrowser(browser, url); |
90 if (tab_in_browser) { | 90 if (tab_in_browser) { |
91 *existing_browser = browser; | 91 *existing_browser = browser; |
92 return tab_in_browser; | 92 return tab_in_browser; |
93 } | 93 } |
94 | 94 |
95 // Then check other browsers. | 95 // Then check other browsers. |
96 for (BrowserList::const_iterator i = BrowserList::begin(); | 96 for (BrowserList::const_iterator i = BrowserList::begin(); |
97 i != BrowserList::end(); ++i) { | 97 i != BrowserList::end(); ++i) { |
98 if (!(*i)->profile()->IsOffTheRecord()) { | 98 if (!(*i)->profile()->IsOffTheRecord() && |
| 99 (*i)->profile()->IsSameProfile(browser->profile())) { |
99 tab_in_browser = FindTabInBrowser(*i, url); | 100 tab_in_browser = FindTabInBrowser(*i, url); |
100 if (tab_in_browser) { | 101 if (tab_in_browser) { |
101 *existing_browser = *i; | 102 *existing_browser = *i; |
102 return tab_in_browser; | 103 return tab_in_browser; |
103 } | 104 } |
104 } | 105 } |
105 } | 106 } |
106 | 107 |
107 return NULL; | 108 return NULL; |
108 } | 109 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 GURL url, | 235 GURL url, |
235 bool success, | 236 bool success, |
236 history::RedirectList* redirects) { | 237 history::RedirectList* redirects) { |
237 if (success && !redirects->empty()) { | 238 if (success && !redirects->empty()) { |
238 TabContents* tab_contents = | 239 TabContents* tab_contents = |
239 callback_consumer_.GetClientDataForCurrentRequest(); | 240 callback_consumer_.GetClientDataForCurrentRequest(); |
240 DCHECK(tab_contents); | 241 DCHECK(tab_contents); |
241 tab_contents_to_url_[tab_contents] = redirects->back(); | 242 tab_contents_to_url_[tab_contents] = redirects->back(); |
242 } | 243 } |
243 } | 244 } |
OLD | NEW |