OLD | NEW |
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 "content/public/browser/web_contents_observer.h" | 8 #include "content/public/browser/web_contents_observer.h" |
9 | 9 |
10 class CoreTabHelperDelegate; | 10 class CoreTabHelperDelegate; |
11 | 11 |
12 // Per-tab class to handle functionality that is core to the operation of tabs. | 12 // Per-tab class to handle functionality that is core to the operation of tabs. |
13 class CoreTabHelper : public content::WebContentsObserver { | 13 class CoreTabHelper : public content::WebContentsObserver { |
14 public: | 14 public: |
15 explicit CoreTabHelper(content::WebContents* web_contents); | 15 explicit CoreTabHelper(content::WebContents* web_contents); |
16 virtual ~CoreTabHelper(); | 16 virtual ~CoreTabHelper(); |
17 | 17 |
18 CoreTabHelperDelegate* delegate() const { return delegate_; } | 18 CoreTabHelperDelegate* delegate() const { return delegate_; } |
19 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } | 19 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } |
20 | 20 |
21 // Initial title assigned to NavigationEntries from Navigate. | 21 // Initial title assigned to NavigationEntries from Navigate. |
22 static string16 GetDefaultTitle(); | 22 static string16 GetDefaultTitle(); |
23 | 23 |
24 // Returns a human-readable description the tab's loading state. | 24 // Returns a human-readable description the tab's loading state. |
25 string16 GetStatusText() const; | 25 string16 GetStatusText() const; |
26 | 26 |
27 private: | 27 private: |
28 // content::WebContentsObserver overrides: | 28 // content::WebContentsObserver overrides: |
29 virtual void WasRestored() OVERRIDE; | 29 virtual void WasShown() OVERRIDE; |
30 | 30 |
31 // Delegate for notifying our owner about stuff. Not owned by us. | 31 // Delegate for notifying our owner about stuff. Not owned by us. |
32 CoreTabHelperDelegate* delegate_; | 32 CoreTabHelperDelegate* delegate_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); | 34 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); |
35 }; | 35 }; |
36 | 36 |
37 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ | 37 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ |
OLD | NEW |