OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_TAB_HELPERS_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_HELPERS_H_ |
6 #define CHROME_BROWSER_UI_TAB_HELPERS_H_ | 6 #define CHROME_BROWSER_UI_TAB_HELPERS_H_ |
7 | 7 |
| 8 #include "base/optional.h" |
| 9 #include "content/public/browser/web_contents.h" |
| 10 |
8 namespace android { | 11 namespace android { |
9 class TabWebContentsDelegateAndroid; | 12 class TabWebContentsDelegateAndroid; |
10 } | 13 } |
11 | 14 |
12 namespace content { | |
13 class WebContents; | |
14 } | |
15 | |
16 namespace chrome { | 15 namespace chrome { |
17 class BrowserTabStripModelDelegate; | 16 class BrowserTabStripModelDelegate; |
18 } | 17 } |
19 | 18 |
20 namespace prerender { | 19 namespace prerender { |
21 class PrerenderContents; | 20 class PrerenderContents; |
22 } | 21 } |
23 | 22 |
24 // A "tab contents" is a WebContents that is used as a tab in a browser window | 23 // A "tab contents" is a WebContents that is used as a tab in a browser window |
25 // (or the equivalent on Android). The TabHelpers class allows specific classes | 24 // (or the equivalent on Android). The TabHelpers class allows specific classes |
(...skipping 27 matching lines...) Expand all Loading... |
53 friend class prerender::PrerenderContents; | 52 friend class prerender::PrerenderContents; |
54 | 53 |
55 // FYI: Do NOT add any more friends here. The functions above are the ONLY | 54 // FYI: Do NOT add any more friends here. The functions above are the ONLY |
56 // ones that need to call AttachTabHelpers; if you think you do, re-read the | 55 // ones that need to call AttachTabHelpers; if you think you do, re-read the |
57 // design document linked above, especially the section "Reusing tab helpers". | 56 // design document linked above, especially the section "Reusing tab helpers". |
58 | 57 |
59 // Adopts the specified WebContents as a full-fledged browser tab, attaching | 58 // Adopts the specified WebContents as a full-fledged browser tab, attaching |
60 // all the associated tab helpers that are needed for the WebContents to | 59 // all the associated tab helpers that are needed for the WebContents to |
61 // serve in that role. It is safe to call this on a WebContents that was | 60 // serve in that role. It is safe to call this on a WebContents that was |
62 // already adopted. | 61 // already adopted. |
63 static void AttachTabHelpers(content::WebContents* web_contents); | 62 static void AttachTabHelpers( |
| 63 content::WebContents* web_contents, |
| 64 const base::Optional<content::WebContents::CreateParams>& create_params); |
64 }; | 65 }; |
65 | 66 |
66 #endif // CHROME_BROWSER_UI_TAB_HELPERS_H_ | 67 #endif // CHROME_BROWSER_UI_TAB_HELPERS_H_ |
OLD | NEW |