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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TAB_HELPERS_H_
6 #define CHROME_BROWSER_UI_TAB_HELPERS_H_
13 class BrowserTabStripModelDelegate
;
16 class ChromeWebContentsDelegateAndroid
;
21 class PrerenderContents
;
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
26 // to attach the set of tab helpers that is used for tab contents.
28 // TODO(avi): This list is rather large, and for most callers it's due to the
29 // fact that they need tab helpers attached early to deal with arbitrary
30 // content loaded into a WebContents that will later be added to the tabstrip.
31 // Is there a better way to handle this? (Ideally, this list would contain
32 // only Browser and BrowserTabStripModelDelegate.)
35 // Browser and its TabStripModelDelegate have intimate control of tabs.
36 // TabAndroid is the equivalent on Android.
38 friend class chrome::BrowserTabStripModelDelegate
;
40 // These are the Android equivalents of the two classes above.
41 friend class TabAndroid
;
42 friend class chrome::android::ChromeWebContentsDelegateAndroid
;
44 // chrome::Navigate creates WebContents that are destined for the tab strip,
45 // and that might have WebUI that immediately calls back into random tab
47 friend class BrowserNavigatorWebContentsAdoption
;
49 // Prerendering loads pages that have arbitrary external content; it needs
50 // the full set of tab helpers to deal with it.
51 friend class prerender::PrerenderContents
;
53 // Adopts the specified WebContents as a full-fledged browser tab, attaching
54 // all the associated tab helpers that are needed for the WebContents to
55 // serve in that role. It is safe to call this on a WebContents that was
57 static void AttachTabHelpers(content::WebContents
* web_contents
);
60 #endif // CHROME_BROWSER_UI_TAB_HELPERS_H_