| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 10 | 10 |
| 11 class CoreTabHelperDelegate; | 11 class CoreTabHelperDelegate; |
| 12 class TabContentsWrapper; | |
| 13 | 12 |
| 14 // 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. |
| 15 class CoreTabHelper : public content::WebContentsObserver { | 14 class CoreTabHelper : public content::WebContentsObserver { |
| 16 public: | 15 public: |
| 17 explicit CoreTabHelper(TabContentsWrapper* wrapper); | 16 explicit CoreTabHelper(content::WebContents* web_contents); |
| 18 virtual ~CoreTabHelper(); | 17 virtual ~CoreTabHelper(); |
| 19 | 18 |
| 20 CoreTabHelperDelegate* delegate() const { return delegate_; } | 19 CoreTabHelperDelegate* delegate() const { return delegate_; } |
| 21 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } | 20 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } |
| 22 | 21 |
| 23 // Initial title assigned to NavigationEntries from Navigate. | 22 // Initial title assigned to NavigationEntries from Navigate. |
| 24 static string16 GetDefaultTitle(); | 23 static string16 GetDefaultTitle(); |
| 25 | 24 |
| 26 // Returns a human-readable description the tab's loading state. | 25 // Returns a human-readable description the tab's loading state. |
| 27 string16 GetStatusText() const; | 26 string16 GetStatusText() const; |
| 28 | 27 |
| 29 private: | 28 private: |
| 30 // content::WebContentsObserver overrides: | 29 // content::WebContentsObserver overrides: |
| 31 virtual void DidBecomeSelected() OVERRIDE; | 30 virtual void DidBecomeSelected() OVERRIDE; |
| 32 | 31 |
| 33 // Delegate for notifying our owner about stuff. Not owned by us. | 32 // Delegate for notifying our owner about stuff. Not owned by us. |
| 34 CoreTabHelperDelegate* delegate_; | 33 CoreTabHelperDelegate* delegate_; |
| 35 | 34 |
| 36 // Our owning TabContentsWrapper. | |
| 37 TabContentsWrapper* wrapper_; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); | 35 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); |
| 40 }; | 36 }; |
| 41 | 37 |
| 42 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ | 38 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ |
| OLD | NEW |