OLD | NEW |
1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
12 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
13 #include "ui/gfx/native_widget_types.h" | |
14 | 15 |
15 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
16 #include "base/mac/foundation_util.h" | 17 #include "base/mac/foundation_util.h" |
17 #endif | 18 #endif |
18 | 19 |
19 #if defined(OS_MACOSX) | 20 #if defined(OS_MACOSX) |
20 class SadTabController; | 21 class SadTabController; |
21 #elif defined(TOOLKIT_VIEWS) | 22 #elif defined(TOOLKIT_VIEWS) |
22 namespace views { | 23 namespace views { |
23 class Widget; | 24 class Widget; |
24 } | 25 } |
25 #elif defined(TOOLKIT_GTK) | 26 #elif defined(TOOLKIT_GTK) |
26 class SadTabGtk; | 27 class SadTabGtk; |
27 #endif | 28 #endif |
28 | 29 |
29 // Per-tab class to manage sad tab views. | 30 // Per-tab class to manage sad tab views. |
30 class SadTabHelper : public content::WebContentsObserver, | 31 class SadTabHelper : public content::WebContentsObserver, |
31 public content::NotificationObserver { | 32 public content::NotificationObserver { |
32 public: | 33 public: |
33 explicit SadTabHelper(content::WebContents* web_contents); | 34 explicit SadTabHelper(content::WebContents* web_contents); |
34 virtual ~SadTabHelper(); | 35 virtual ~SadTabHelper(); |
35 | 36 |
36 // 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. |
37 bool HasSadTab(); | 38 bool HasSadTab() const; |
38 | 39 |
39 #if defined(TOOLKIT_VIEWS) | 40 #if defined(TOOLKIT_VIEWS) |
40 views::Widget* sad_tab() { return sad_tab_.get(); } | 41 views::Widget* sad_tab() { return sad_tab_.get(); } |
41 #endif | 42 #endif |
42 | 43 |
43 private: | 44 private: |
44 // Platform specific function to get an instance of the sad tab page. | 45 // Platform specific function to get an instance of the sad tab page. |
45 void InstallSadTab(base::TerminationStatus status); | 46 void InstallSadTab(base::TerminationStatus status); |
46 | 47 |
47 // Overridden from content::WebContentsObserver: | 48 // Overridden from content::WebContentsObserver: |
(...skipping 19 matching lines...) Expand all Loading... |
67 #elif defined(TOOLKIT_VIEWS) | 68 #elif defined(TOOLKIT_VIEWS) |
68 scoped_ptr<views::Widget> sad_tab_; | 69 scoped_ptr<views::Widget> sad_tab_; |
69 #elif defined(TOOLKIT_GTK) | 70 #elif defined(TOOLKIT_GTK) |
70 scoped_ptr<SadTabGtk> sad_tab_; | 71 scoped_ptr<SadTabGtk> sad_tab_; |
71 #endif | 72 #endif |
72 | 73 |
73 DISALLOW_COPY_AND_ASSIGN(SadTabHelper); | 74 DISALLOW_COPY_AND_ASSIGN(SadTabHelper); |
74 }; | 75 }; |
75 | 76 |
76 #endif // CHROME_BROWSER_UI_SAD_TAB_HELPER_H_ | 77 #endif // CHROME_BROWSER_UI_SAD_TAB_HELPER_H_ |
OLD | NEW |