summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-10 16:16:40 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-10 16:16:40 +0000
commit9567f9cc4114c1f004aa57a5cb166f07e9c86693 (patch)
tree7473450b0322cf354b21ef8061f426efaceaeb87 /chrome/browser/tab_contents
parentbed56af283f2f3426cb6c9549518393032cebd84 (diff)
downloadchromium_src-9567f9cc4114c1f004aa57a5cb166f07e9c86693.zip
chromium_src-9567f9cc4114c1f004aa57a5cb166f07e9c86693.tar.gz
chromium_src-9567f9cc4114c1f004aa57a5cb166f07e9c86693.tar.bz2
Switch Extensions::TabHelper to use WebContents, WebContentsUserData.
BUG=107201 TEST=no visible change TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10917026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/web_contents_user_data.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/web_contents_user_data.h b/chrome/browser/tab_contents/web_contents_user_data.h
index 3fe60c2..ba300a9 100644
--- a/chrome/browser/tab_contents/web_contents_user_data.h
+++ b/chrome/browser/tab_contents/web_contents_user_data.h
@@ -38,6 +38,13 @@ class WebContentsUserData : public base::SupportsUserData::Data {
static T* FromWebContents(content::WebContents* contents) {
return static_cast<T*>(contents->GetUserData(&T::kUserDataKey));
}
+
+ // Retrieves the instance of type T that was attached to the specified
+ // WebContents (via CreateForWebContents above) and returns it. If no instance
+ // of the type was attached, returns NULL.
+ static const T* FromWebContents(const content::WebContents* contents) {
+ return static_cast<const T*>(contents->GetUserData(&T::kUserDataKey));
+ }
};
#endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_USER_DATA_H_