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

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

Issue 382133003: Refactored ExtensionUninstallDialog to take a NativeWindow instead of a Browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed ExtensionUninstallDialog to take a NativeWindow instead of a Browser Created 6 years, 5 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 | Annotate | Revision Log
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 if (!window) 151 if (!window)
152 return NULL; 152 return NULL;
153 for (BrowserIterator it; !it.done(); it.Next()) { 153 for (BrowserIterator it; !it.done(); it.Next()) {
154 Browser* browser = *it; 154 Browser* browser = *it;
155 if (browser->window() && browser->window()->GetNativeWindow() == window) 155 if (browser->window() && browser->window()->GetNativeWindow() == window)
156 return browser; 156 return browser;
157 } 157 }
158 return NULL; 158 return NULL;
159 } 159 }
160 160
161 gfx::NativeWindow FindWindowForBrowser(Browser* browser) {
162 if (browser && browser->window())
163 return browser->window()->GetNativeWindow();
164 return NULL;
165 }
166
161 Browser* FindBrowserWithWebContents(const WebContents* web_contents) { 167 Browser* FindBrowserWithWebContents(const WebContents* web_contents) {
162 DCHECK(web_contents); 168 DCHECK(web_contents);
163 for (TabContentsIterator it; !it.done(); it.Next()) { 169 for (TabContentsIterator it; !it.done(); it.Next()) {
164 if (*it == web_contents) 170 if (*it == web_contents)
165 return it.browser(); 171 return it.browser();
166 } 172 }
167 return NULL; 173 return NULL;
168 } 174 }
169 175
170 Browser* FindLastActiveWithProfile(Profile* profile, HostDesktopType type) { 176 Browser* FindLastActiveWithProfile(Profile* profile, HostDesktopType type) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 208
203 size_t GetBrowserCount(Profile* profile, HostDesktopType type) { 209 size_t GetBrowserCount(Profile* profile, HostDesktopType type) {
204 return GetBrowserCountImpl(profile, type, kMatchAny); 210 return GetBrowserCountImpl(profile, type, kMatchAny);
205 } 211 }
206 212
207 size_t GetTabbedBrowserCount(Profile* profile, HostDesktopType type) { 213 size_t GetTabbedBrowserCount(Profile* profile, HostDesktopType type) {
208 return GetBrowserCountImpl(profile, type, kMatchTabbed); 214 return GetBrowserCountImpl(profile, type, kMatchTabbed);
209 } 215 }
210 216
211 } // namespace chrome 217 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698