OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_UTIL_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_UTIL_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_UTIL_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 class GURL; | 9 class GURL; |
10 class Profile; | 10 class Profile; |
| 11 class TabContents; |
| 12 |
| 13 namespace content { |
11 class SiteInstance; | 14 class SiteInstance; |
12 class TabContents; | |
13 namespace content { | |
14 class WebContents; | 15 class WebContents; |
15 } | 16 } |
16 | 17 |
17 namespace tab_util { | 18 namespace tab_util { |
18 | 19 |
19 // Helper to find the TabContents that originated the given request. Can be | 20 // Helper to find the TabContents that originated the given request. Can be |
20 // NULL if the tab has been closed or some other error occurs. | 21 // NULL if the tab has been closed or some other error occurs. |
21 // Should only be called from the UI thread, since it accesses TabContent. | 22 // Should only be called from the UI thread, since it accesses TabContent. |
22 // TODO(jam): remove TabContents version | 23 // TODO(jam): remove TabContents version |
23 TabContents* GetTabContentsByID(int render_process_id, int render_view_id); | 24 TabContents* GetTabContentsByID(int render_process_id, int render_view_id); |
24 content::WebContents* GetWebContentsByID(int render_process_id, | 25 content::WebContents* GetWebContentsByID(int render_process_id, |
25 int render_view_id); | 26 int render_view_id); |
26 | 27 |
27 // Returns a new SiteInstance for WebUI and app URLs. Returns the SiteInstance | 28 // Returns a new SiteInstance for WebUI and app URLs. Returns the SiteInstance |
28 // for |source_contents| if it represents the same website as |url|. Returns | 29 // for |source_contents| if it represents the same website as |url|. Returns |
29 // NULL otherwise. | 30 // NULL otherwise. |
30 SiteInstance* GetSiteInstanceForNewTab(content::WebContents* source_contents, | 31 content::SiteInstance* GetSiteInstanceForNewTab( |
31 Profile* profile, | 32 content::WebContents* source_contents, |
32 const GURL& url); | 33 Profile* profile, |
| 34 const GURL& url); |
33 | 35 |
34 } // namespace tab_util | 36 } // namespace tab_util |
35 | 37 |
36 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_UTIL_H_ | 38 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_UTIL_H_ |
OLD | NEW |