OLD | NEW |
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_tabstrip.h" | 5 #include "chrome/browser/ui/browser_tabstrip.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 9 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 namespace chrome { | 28 namespace chrome { |
29 | 29 |
30 content::WebContents* GetActiveWebContents(const Browser* browser) { | 30 content::WebContents* GetActiveWebContents(const Browser* browser) { |
31 return browser->tab_strip_model()->GetActiveWebContents(); | 31 return browser->tab_strip_model()->GetActiveWebContents(); |
32 } | 32 } |
33 | 33 |
34 content::WebContents* GetWebContentsAt(const Browser* browser, int index) { | 34 content::WebContents* GetWebContentsAt(const Browser* browser, int index) { |
35 return browser->tab_strip_model()->GetWebContentsAt(index); | 35 return browser->tab_strip_model()->GetWebContentsAt(index); |
36 } | 36 } |
37 | 37 |
38 void ActivateTabAt(Browser* browser, int index, bool user_gesture) { | |
39 browser->tab_strip_model()->ActivateTabAt(index, user_gesture); | |
40 } | |
41 | |
42 void AddBlankTabAt(Browser* browser, int index, bool foreground) { | 38 void AddBlankTabAt(Browser* browser, int index, bool foreground) { |
43 // TODO(scottmg): http://crbug.com/128578 | 39 // TODO(scottmg): http://crbug.com/128578 |
44 // This is necessary because WebContentsViewAura doesn't have enough context | 40 // This is necessary because WebContentsViewAura doesn't have enough context |
45 // to get the right StackingClient (and therefore parent window) otherwise. | 41 // to get the right StackingClient (and therefore parent window) otherwise. |
46 ScopedForceDesktopType force_desktop_type(browser->host_desktop_type()); | 42 ScopedForceDesktopType force_desktop_type(browser->host_desktop_type()); |
47 | 43 |
48 // Time new tab page creation time. We keep track of the timing data in | 44 // Time new tab page creation time. We keep track of the timing data in |
49 // WebContents, but we want to include the time it takes to create the | 45 // WebContents, but we want to include the time it takes to create the |
50 // WebContents object too. | 46 // WebContents object too. |
51 base::TimeTicks new_tab_start_time = base::TimeTicks::Now(); | 47 base::TimeTicks new_tab_start_time = base::TimeTicks::Now(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 int routing_id, | 143 int routing_id, |
148 const content::WebContents* base_web_contents) { | 144 const content::WebContents* base_web_contents) { |
149 return BrowserTabstripTabContentsCreator::CreateTabContents( | 145 return BrowserTabstripTabContentsCreator::CreateTabContents( |
150 content::WebContents::Create(profile, | 146 content::WebContents::Create(profile, |
151 site_instance, | 147 site_instance, |
152 routing_id, | 148 routing_id, |
153 base_web_contents)); | 149 base_web_contents)); |
154 } | 150 } |
155 | 151 |
156 } // namespace chrome | 152 } // namespace chrome |
OLD | NEW |