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

Side by Side Diff: chrome/browser/ui/sad_tab_helper.h

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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_SAD_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_UI_SAD_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_SAD_TAB_HELPER_H_ 6 #define CHROME_BROWSER_UI_SAD_TAB_HELPER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 25 matching lines...) Expand all
36 36
37 // Platform specific function to determine if there is a current sad tab page. 37 // Platform specific function to determine if there is a current sad tab page.
38 bool HasSadTab() const; 38 bool HasSadTab() const;
39 39
40 #if defined(TOOLKIT_VIEWS) 40 #if defined(TOOLKIT_VIEWS)
41 views::Widget* sad_tab() { return sad_tab_.get(); } 41 views::Widget* sad_tab() { return sad_tab_.get(); }
42 #endif 42 #endif
43 43
44 private: 44 private:
45 explicit SadTabHelper(content::WebContents* web_contents); 45 explicit SadTabHelper(content::WebContents* web_contents);
46 static int kUserDataKey;
47 friend class WebContentsUserData<SadTabHelper>; 46 friend class WebContentsUserData<SadTabHelper>;
48 47
49 // Platform specific function to get an instance of the sad tab page. 48 // Platform specific function to get an instance of the sad tab page.
50 void InstallSadTab(base::TerminationStatus status); 49 void InstallSadTab(base::TerminationStatus status);
51 50
52 // Overridden from content::WebContentsObserver: 51 // Overridden from content::WebContentsObserver:
53 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; 52 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
54 53
55 // Overridden from content::NotificationObserver: 54 // Overridden from content::NotificationObserver:
56 virtual void Observe(int type, 55 virtual void Observe(int type,
(...skipping 15 matching lines...) Expand all
72 #elif defined(TOOLKIT_VIEWS) 71 #elif defined(TOOLKIT_VIEWS)
73 scoped_ptr<views::Widget> sad_tab_; 72 scoped_ptr<views::Widget> sad_tab_;
74 #elif defined(TOOLKIT_GTK) 73 #elif defined(TOOLKIT_GTK)
75 scoped_ptr<SadTabGtk> sad_tab_; 74 scoped_ptr<SadTabGtk> sad_tab_;
76 #endif 75 #endif
77 76
78 DISALLOW_COPY_AND_ASSIGN(SadTabHelper); 77 DISALLOW_COPY_AND_ASSIGN(SadTabHelper);
79 }; 78 };
80 79
81 #endif // CHROME_BROWSER_UI_SAD_TAB_HELPER_H_ 80 #endif // CHROME_BROWSER_UI_SAD_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698