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

Side by Side Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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_list.h" 5 #include "chrome/browser/ui/browser_list.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/browser_shutdown.h" 12 #include "chrome/browser/browser_shutdown.h"
13 #include "chrome/browser/download/download_service.h" 13 #include "chrome/browser/download/download_service.h"
14 #include "chrome/browser/metrics/thread_watcher.h" 14 #include "chrome/browser/metrics/thread_watcher.h"
15 #include "chrome/browser/prefs/pref_service.h" 15 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_manager.h" 17 #include "chrome/browser/profiles/profile_manager.h"
18 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
19 #include "chrome/browser/ui/browser_tabstrip.h"
19 #include "chrome/browser/ui/browser_window.h" 20 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/browser/ui/tab_contents/tab_contents.h" 21 #include "chrome/browser/ui/tab_contents/tab_contents.h"
21 #include "chrome/common/chrome_notification_types.h" 22 #include "chrome/common/chrome_notification_types.h"
22 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
23 #include "chrome/common/pref_names.h" 24 #include "chrome/common/pref_names.h"
24 #include "content/public/browser/browser_shutdown.h" 25 #include "content/public/browser/browser_shutdown.h"
25 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
26 #include "content/public/browser/navigation_details.h" 27 #include "content/public/browser/navigation_details.h"
27 #include "content/public/browser/notification_service.h" 28 #include "content/public/browser/notification_service.h"
28 29
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ++i; 190 ++i;
190 } else { 191 } else {
191 // This path is hit during logoff/power-down. In this case we won't get 192 // This path is hit during logoff/power-down. In this case we won't get
192 // a final message and so we force the browser to be deleted. 193 // a final message and so we force the browser to be deleted.
193 // Close doesn't immediately destroy the browser 194 // Close doesn't immediately destroy the browser
194 // (Browser::TabStripEmpty() uses invoke later) but when we're ending the 195 // (Browser::TabStripEmpty() uses invoke later) but when we're ending the
195 // session we need to make sure the browser is destroyed now. So, invoke 196 // session we need to make sure the browser is destroyed now. So, invoke
196 // DestroyBrowser to make sure the browser is deleted and cleanup can 197 // DestroyBrowser to make sure the browser is deleted and cleanup can
197 // happen. 198 // happen.
198 while (browser->tab_count()) 199 while (browser->tab_count())
199 delete browser->GetTabContentsAt(0); 200 delete chrome::GetTabContentsAt(browser, 0);
200 browser->window()->DestroyBrowser(); 201 browser->window()->DestroyBrowser();
201 i = BrowserList::begin(); 202 i = BrowserList::begin();
202 if (i != BrowserList::end() && browser == *i) { 203 if (i != BrowserList::end() && browser == *i) {
203 // Destroying the browser should have removed it from the browser list. 204 // Destroying the browser should have removed it from the browser list.
204 // We should never get here. 205 // We should never get here.
205 NOTREACHED(); 206 NOTREACHED();
206 return; 207 return;
207 } 208 }
208 } 209 }
209 } 210 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 MessageLoop::current()) 360 MessageLoop::current())
360 CloseAllBrowsers(); 361 CloseAllBrowsers();
361 } 362 }
362 } 363 }
363 364
364 bool WillKeepAlive() { 365 bool WillKeepAlive() {
365 return g_keep_alive_count > 0; 366 return g_keep_alive_count > 0;
366 } 367 }
367 368
368 } // namespace browser 369 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/loadtimes_extension_bindings_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698