Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "app/animation.h" | 7 #include "app/animation.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/idle_timer.h" | 10 #include "base/idle_timer.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 } | 326 } |
| 327 | 327 |
| 328 /////////////////////////////////////////////////////////////////////////////// | 328 /////////////////////////////////////////////////////////////////////////////// |
| 329 // Browser, Creation Helpers: | 329 // Browser, Creation Helpers: |
| 330 | 330 |
| 331 // static | 331 // static |
| 332 void Browser::OpenEmptyWindow(Profile* profile) { | 332 void Browser::OpenEmptyWindow(Profile* profile) { |
| 333 Browser* browser = Browser::Create(profile); | 333 Browser* browser = Browser::Create(profile); |
| 334 browser->AddBlankTab(true); | 334 browser->AddBlankTab(true); |
| 335 browser->window()->Show(); | 335 browser->window()->Show(); |
| 336 browser->window()->Activate(); | |
|
John Grabowski
2009/09/16 20:14:02
Good catch to do this from the dock, but we'd only
| |
| 336 } | 337 } |
| 337 | 338 |
| 338 // static | 339 // static |
| 339 void Browser::OpenWindowWithRestoredTabs(Profile* profile) { | 340 void Browser::OpenWindowWithRestoredTabs(Profile* profile) { |
| 340 TabRestoreService* service = profile->GetTabRestoreService(); | 341 TabRestoreService* service = profile->GetTabRestoreService(); |
| 341 if (service) | 342 if (service) |
| 342 service->RestoreMostRecentEntry(NULL); | 343 service->RestoreMostRecentEntry(NULL); |
| 343 } | 344 } |
| 344 | 345 |
| 345 // static | 346 // static |
| (...skipping 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2912 /////////////////////////////////////////////////////////////////////////////// | 2913 /////////////////////////////////////////////////////////////////////////////// |
| 2913 // BrowserToolbarModel (private): | 2914 // BrowserToolbarModel (private): |
| 2914 | 2915 |
| 2915 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2916 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2916 // This |current_tab| can be NULL during the initialization of the | 2917 // This |current_tab| can be NULL during the initialization of the |
| 2917 // toolbar during window creation (i.e. before any tabs have been added | 2918 // toolbar during window creation (i.e. before any tabs have been added |
| 2918 // to the window). | 2919 // to the window). |
| 2919 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2920 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2920 return current_tab ? ¤t_tab->controller() : NULL; | 2921 return current_tab ? ¤t_tab->controller() : NULL; |
| 2921 } | 2922 } |
| OLD | NEW |