| 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_list.h" | 8 #include "chrome/browser/ui/browser_list.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if ((*i)->session_id().id() == desired_id) | 142 if ((*i)->session_id().id() == desired_id) |
| 143 return *i; | 143 return *i; |
| 144 } | 144 } |
| 145 return NULL; | 145 return NULL; |
| 146 } | 146 } |
| 147 | 147 |
| 148 Browser* FindBrowserWithWindow(gfx::NativeWindow window) { | 148 Browser* FindBrowserWithWindow(gfx::NativeWindow window) { |
| 149 for (BrowserList::const_iterator it = BrowserList::begin(); | 149 for (BrowserList::const_iterator it = BrowserList::begin(); |
| 150 it != BrowserList::end(); ++it) { | 150 it != BrowserList::end(); ++it) { |
| 151 Browser* browser = *it; | 151 Browser* browser = *it; |
| 152 if (browser->window() && browser->window()->GetNativeHandle() == window) | 152 if (browser->window() && browser->window()->GetNativeWindow() == window) |
| 153 return browser; | 153 return browser; |
| 154 } | 154 } |
| 155 return NULL; | 155 return NULL; |
| 156 } | 156 } |
| 157 | 157 |
| 158 Browser* FindBrowserWithWebContents(WebContents* web_contents) { | 158 Browser* FindBrowserWithWebContents(WebContents* web_contents) { |
| 159 DCHECK(web_contents); | 159 DCHECK(web_contents); |
| 160 for (TabContentsIterator it; !it.done(); ++it) { | 160 for (TabContentsIterator it; !it.done(); ++it) { |
| 161 if (it->web_contents() == web_contents) | 161 if (it->web_contents() == web_contents) |
| 162 return it.browser(); | 162 return it.browser(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 190 | 190 |
| 191 size_t GetBrowserCount(Profile* profile) { | 191 size_t GetBrowserCount(Profile* profile) { |
| 192 return GetBrowserCountImpl(profile, kMatchAny); | 192 return GetBrowserCountImpl(profile, kMatchAny); |
| 193 } | 193 } |
| 194 | 194 |
| 195 size_t GetTabbedBrowserCount(Profile* profile) { | 195 size_t GetTabbedBrowserCount(Profile* profile) { |
| 196 return GetBrowserCountImpl(profile, kMatchTabbed); | 196 return GetBrowserCountImpl(profile, kMatchTabbed); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace browser | 199 } // namespace browser |
| OLD | NEW |