Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: chrome/browser/ui/tab_contents/core_tab_helper.h

Issue 10905301: Switch CoreTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CONTENTS_CORE_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
7 7
8 #include "chrome/browser/tab_contents/web_contents_user_data.h"
8 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
9 10
10 class CoreTabHelperDelegate; 11 class CoreTabHelperDelegate;
11 12
12 // Per-tab class to handle functionality that is core to the operation of tabs. 13 // Per-tab class to handle functionality that is core to the operation of tabs.
13 class CoreTabHelper : public content::WebContentsObserver { 14 class CoreTabHelper : public content::WebContentsObserver,
15 public WebContentsUserData<CoreTabHelper> {
14 public: 16 public:
15 explicit CoreTabHelper(content::WebContents* web_contents);
16 virtual ~CoreTabHelper(); 17 virtual ~CoreTabHelper();
17 18
18 CoreTabHelperDelegate* delegate() const { return delegate_; } 19 CoreTabHelperDelegate* delegate() const { return delegate_; }
19 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } 20 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; }
20 21
21 // Initial title assigned to NavigationEntries from Navigate. 22 // Initial title assigned to NavigationEntries from Navigate.
22 static string16 GetDefaultTitle(); 23 static string16 GetDefaultTitle();
23 24
24 // Returns a human-readable description the tab's loading state. 25 // Returns a human-readable description the tab's loading state.
25 string16 GetStatusText() const; 26 string16 GetStatusText() const;
26 27
27 private: 28 private:
29 explicit CoreTabHelper(content::WebContents* web_contents);
30 static int kUserDataKey;
31 friend class WebContentsUserData<CoreTabHelper>;
32
28 // content::WebContentsObserver overrides: 33 // content::WebContentsObserver overrides:
29 virtual void WasShown() OVERRIDE; 34 virtual void WasShown() OVERRIDE;
30 35
31 // Delegate for notifying our owner about stuff. Not owned by us. 36 // Delegate for notifying our owner about stuff. Not owned by us.
32 CoreTabHelperDelegate* delegate_; 37 CoreTabHelperDelegate* delegate_;
33 38
34 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); 39 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper);
35 }; 40 };
36 41
37 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ 42 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_adoption.cc ('k') | chrome/browser/ui/tab_contents/core_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698