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