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

Side by Side Diff: chrome/browser/browser_list.cc

Issue 79070: createWindow api call. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « chrome/browser/browser_list.h ('k') | chrome/browser/extensions/extension_function.h » ('j') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/browser_list.h" 7 #include "chrome/browser/browser_list.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 // static 188 // static
189 Browser* BrowserList::GetLastActive() { 189 Browser* BrowserList::GetLastActive() {
190 if (!last_active_browsers_.empty()) 190 if (!last_active_browsers_.empty())
191 return *(last_active_browsers_.rbegin()); 191 return *(last_active_browsers_.rbegin());
192 192
193 return NULL; 193 return NULL;
194 } 194 }
195 195
196 // static 196 // static
197 Browser* BrowserList::GetLastActiveWithProfile(Profile* p) {
198 list_type::reverse_iterator browser = last_active_browsers_.rbegin();
199 for (; browser != last_active_browsers_.rend(); ++browser) {
200 if ((*browser)->profile() == p) {
201 return *browser;
202 }
203 }
204
205 return NULL;
206 }
207
208 // static
197 Browser* BrowserList::FindBrowserWithType(Profile* p, Browser::Type t) { 209 Browser* BrowserList::FindBrowserWithType(Profile* p, Browser::Type t) {
198 Browser* last_active = GetLastActive(); 210 Browser* last_active = GetLastActive();
199 if (last_active && last_active->profile() == p && last_active->type() == t) 211 if (last_active && last_active->profile() == p && last_active->type() == t)
200 return last_active; 212 return last_active;
201 213
202 BrowserList::const_iterator i; 214 BrowserList::const_iterator i;
203 for (i = BrowserList::begin(); i != BrowserList::end(); ++i) { 215 for (i = BrowserList::begin(); i != BrowserList::end(); ++i) {
204 if (*i == last_active) 216 if (*i == last_active)
205 continue; 217 continue;
206 218
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 300 }
289 301
290 WebContents* next_tab = 302 WebContents* next_tab =
291 (*browser_iterator_)->GetTabContentsAt(web_view_index_)->AsWebContents(); 303 (*browser_iterator_)->GetTabContentsAt(web_view_index_)->AsWebContents();
292 if (next_tab) { 304 if (next_tab) {
293 cur_ = next_tab; 305 cur_ = next_tab;
294 return; 306 return;
295 } 307 }
296 } 308 }
297 } 309 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_list.h ('k') | chrome/browser/extensions/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698