OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 10 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 11 |
| 12 class CoreTabHelperDelegate; |
| 13 class TabContentsWrapper; |
| 14 |
| 15 // Per-tab class to handle functionality that is core to the operation of tabs. |
| 16 class CoreTabHelper : public TabContentsObserver, |
| 17 public content::NotificationObserver { |
| 18 public: |
| 19 explicit CoreTabHelper(TabContentsWrapper* wrapper); |
| 20 virtual ~CoreTabHelper(); |
| 21 |
| 22 CoreTabHelperDelegate* delegate() const { return delegate_; } |
| 23 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } |
| 24 |
| 25 // Initial title assigned to NavigationEntries from Navigate. |
| 26 static string16 GetDefaultTitle(); |
| 27 |
| 28 // Returns a human-readable description the tab's loading state. |
| 29 string16 GetStatusText() const; |
| 30 |
| 31 private: |
| 32 // TabContentsObserver overrides: |
| 33 virtual void DidBecomeSelected() OVERRIDE; |
| 34 |
| 35 // content::NotificationObserver overrides: |
| 36 virtual void Observe(int type, |
| 37 const content::NotificationSource& source, |
| 38 const content::NotificationDetails& details) OVERRIDE; |
| 39 |
| 40 // Delegate for notifying our owner about stuff. Not owned by us. |
| 41 CoreTabHelperDelegate* delegate_; |
| 42 |
| 43 // Our owning TabContentsWrapper. |
| 44 TabContentsWrapper* wrapper_; |
| 45 |
| 46 PrefChangeRegistrar pref_change_registrar_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); |
| 49 }; |
| 50 |
| 51 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ |
OLD | NEW |