| 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/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
| (...skipping 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 /////////////////////////////////////////////////////////////////////////////// | 1507 /////////////////////////////////////////////////////////////////////////////// |
| 1508 // Browser, TabStripModelDelegate implementation: | 1508 // Browser, TabStripModelDelegate implementation: |
| 1509 | 1509 |
| 1510 TabContents* Browser::AddBlankTab(bool foreground) { | 1510 TabContents* Browser::AddBlankTab(bool foreground) { |
| 1511 return AddBlankTabAt(-1, foreground); | 1511 return AddBlankTabAt(-1, foreground); |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 TabContents* Browser::AddBlankTabAt(int index, bool foreground) { | 1514 TabContents* Browser::AddBlankTabAt(int index, bool foreground) { |
| 1515 return AddTabWithURL(GURL(chrome::kChromeUINewTabURL), GURL(), | 1515 // Time new tab page creation time. We keep track of the timing data in |
| 1516 PageTransition::TYPED, foreground, index, false, NULL); | 1516 // TabContents, but we want to include the time it takes to create the |
| 1517 // TabContents object too. |
| 1518 base::TimeTicks new_tab_start_time = base::TimeTicks::Now(); |
| 1519 TabContents* tab_contents = AddTabWithURL(GURL(chrome::kChromeUINewTabURL), |
| 1520 GURL(), PageTransition::TYPED, foreground, index, false, NULL); |
| 1521 tab_contents->set_new_tab_start_time(new_tab_start_time); |
| 1522 return tab_contents; |
| 1517 } | 1523 } |
| 1518 | 1524 |
| 1519 Browser* Browser::CreateNewStripWithContents(TabContents* detached_contents, | 1525 Browser* Browser::CreateNewStripWithContents(TabContents* detached_contents, |
| 1520 const gfx::Rect& window_bounds, | 1526 const gfx::Rect& window_bounds, |
| 1521 const DockInfo& dock_info) { | 1527 const DockInfo& dock_info) { |
| 1522 DCHECK(type_ == TYPE_NORMAL); | 1528 DCHECK(type_ == TYPE_NORMAL); |
| 1523 | 1529 |
| 1524 gfx::Rect new_window_bounds = window_bounds; | 1530 gfx::Rect new_window_bounds = window_bounds; |
| 1525 bool maximize = false; | 1531 bool maximize = false; |
| 1526 if (dock_info.GetNewWindowBounds(&new_window_bounds, &maximize)) | 1532 if (dock_info.GetNewWindowBounds(&new_window_bounds, &maximize)) |
| (...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2963 /////////////////////////////////////////////////////////////////////////////// | 2969 /////////////////////////////////////////////////////////////////////////////// |
| 2964 // BrowserToolbarModel (private): | 2970 // BrowserToolbarModel (private): |
| 2965 | 2971 |
| 2966 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2972 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2967 // This |current_tab| can be NULL during the initialization of the | 2973 // This |current_tab| can be NULL during the initialization of the |
| 2968 // toolbar during window creation (i.e. before any tabs have been added | 2974 // toolbar during window creation (i.e. before any tabs have been added |
| 2969 // to the window). | 2975 // to the window). |
| 2970 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2976 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2971 return current_tab ? ¤t_tab->controller() : NULL; | 2977 return current_tab ? ¤t_tab->controller() : NULL; |
| 2972 } | 2978 } |
| OLD | NEW |