| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2350 return AddBlankTabAt(-1, foreground); | 2350 return AddBlankTabAt(-1, foreground); |
| 2351 } | 2351 } |
| 2352 | 2352 |
| 2353 TabContents* Browser::AddBlankTabAt(int index, bool foreground) { | 2353 TabContents* Browser::AddBlankTabAt(int index, bool foreground) { |
| 2354 // Time new tab page creation time. We keep track of the timing data in | 2354 // Time new tab page creation time. We keep track of the timing data in |
| 2355 // TabContents, but we want to include the time it takes to create the | 2355 // TabContents, but we want to include the time it takes to create the |
| 2356 // TabContents object too. | 2356 // TabContents object too. |
| 2357 base::TimeTicks new_tab_start_time = base::TimeTicks::Now(); | 2357 base::TimeTicks new_tab_start_time = base::TimeTicks::Now(); |
| 2358 browser::NavigateParams params(this, GURL(chrome::kChromeUINewTabURL), | 2358 browser::NavigateParams params(this, GURL(chrome::kChromeUINewTabURL), |
| 2359 PageTransition::TYPED); | 2359 PageTransition::TYPED); |
| 2360 params.tabstrip_add_types = | |
| 2361 foreground ? TabStripModel::ADD_SELECTED : TabStripModel::ADD_NONE; | |
| 2362 params.disposition = foreground ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; | 2360 params.disposition = foreground ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; |
| 2363 params.tabstrip_index = index; | 2361 params.tabstrip_index = index; |
| 2364 browser::Navigate(¶ms); | 2362 browser::Navigate(¶ms); |
| 2365 params.target_contents->set_new_tab_start_time(new_tab_start_time); | 2363 params.target_contents->set_new_tab_start_time(new_tab_start_time); |
| 2366 return params.target_contents; | 2364 return params.target_contents; |
| 2367 } | 2365 } |
| 2368 | 2366 |
| 2369 Browser* Browser::CreateNewStripWithContents(TabContents* detached_contents, | 2367 Browser* Browser::CreateNewStripWithContents(TabContents* detached_contents, |
| 2370 const gfx::Rect& window_bounds, | 2368 const gfx::Rect& window_bounds, |
| 2371 const DockInfo& dock_info, | 2369 const DockInfo& dock_info, |
| (...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4088 NOTREACHED(); | 4086 NOTREACHED(); |
| 4089 return false; | 4087 return false; |
| 4090 } | 4088 } |
| 4091 | 4089 |
| 4092 void Browser::CreateInstantIfNecessary() { | 4090 void Browser::CreateInstantIfNecessary() { |
| 4093 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && | 4091 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && |
| 4094 !profile()->IsOffTheRecord()) { | 4092 !profile()->IsOffTheRecord()) { |
| 4095 instant_.reset(new InstantController(profile_, this)); | 4093 instant_.reset(new InstantController(profile_, this)); |
| 4096 } | 4094 } |
| 4097 } | 4095 } |
| OLD | NEW |