| 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 namespace content { | 8 namespace content { |
| 9 class WebContents; | 9 class WebContents; |
| 10 } | 10 } |
| 11 | 11 |
| 12 namespace chrome { | 12 namespace chrome { |
| 13 class BrowserTabStripModelDelegate; | 13 class BrowserTabStripModelDelegate; |
| 14 | 14 |
| 15 namespace android { | 15 namespace android { |
| 16 class ChromeWebContentsDelegateAndroid; | 16 class ChromeWebContentsDelegateAndroid; |
| 17 } | 17 } |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace prerender { | 20 namespace prerender { |
| 21 class PrerenderContents; | 21 class PrerenderContents; |
| 22 } | 22 } |
| 23 | 23 |
| 24 // 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 |
| 25 // (or the equivalent on Android). The TabHelpers class allows specific classes | 25 // (or the equivalent on Android). The TabHelpers class allows specific classes |
| 26 // to attach the set of tab helpers that is used for tab contents. | 26 // to attach the set of tab helpers that is used for tab contents. |
| 27 // | 27 // |
| 28 // https://www.chromium.org/developers/design-documents/tab-helpers | 28 // https://chromium.googlesource.com/chromium/src/+/master/docs/tab_helpers.md |
| 29 // | 29 // |
| 30 // TODO(avi): This list is rather large, and for most callers it's due to the | 30 // TODO(avi): This list is rather large, and for most callers it's due to the |
| 31 // fact that they need tab helpers attached early to deal with arbitrary | 31 // fact that they need tab helpers attached early to deal with arbitrary |
| 32 // content loaded into a WebContents that will later be added to the tabstrip. | 32 // content loaded into a WebContents that will later be added to the tabstrip. |
| 33 // Is there a better way to handle this? (Ideally, this list would contain | 33 // Is there a better way to handle this? (Ideally, this list would contain |
| 34 // only Browser and BrowserTabStripModelDelegate.) | 34 // only Browser and BrowserTabStripModelDelegate.) |
| 35 class TabHelpers { | 35 class TabHelpers { |
| 36 private: | 36 private: |
| 37 // Browser and its TabStripModelDelegate have intimate control of tabs. | 37 // Browser and its TabStripModelDelegate have intimate control of tabs. |
| 38 // TabAndroid is the equivalent on Android. | 38 // TabAndroid is the equivalent on Android. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 57 // design document linked above, especially the section "Reusing tab helpers". | 57 // design document linked above, especially the section "Reusing tab helpers". |
| 58 | 58 |
| 59 // Adopts the specified WebContents as a full-fledged browser tab, attaching | 59 // Adopts the specified WebContents as a full-fledged browser tab, attaching |
| 60 // 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 |
| 61 // 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 |
| 62 // already adopted. | 62 // already adopted. |
| 63 static void AttachTabHelpers(content::WebContents* web_contents); | 63 static void AttachTabHelpers(content::WebContents* web_contents); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 #endif // CHROME_BROWSER_UI_TAB_HELPERS_H_ | 66 #endif // CHROME_BROWSER_UI_TAB_HELPERS_H_ |
| OLD | NEW |