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

Unified Diff: chrome/browser/ui/tab_contents/core_tab_helper.h

Issue 8865004: Create CoreTabHelper, move remaining core TCW functionality into it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lots of helpers now Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/tab_contents/core_tab_helper.h
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.h b/chrome/browser/ui/tab_contents/core_tab_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..302fb1cc467be630be2d5650b58977b3a0895202
--- /dev/null
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
+#define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
+#pragma once
+
+#include "chrome/browser/prefs/pref_change_registrar.h"
+#include "content/browser/tab_contents/tab_contents_observer.h"
+
+class CoreTabHelperDelegate;
+class TabContentsWrapper;
+
+// Per-tab class to handle functionality that is core to the operation of tabs.
+class CoreTabHelper : public TabContentsObserver,
+ public content::NotificationObserver {
+ public:
+ explicit CoreTabHelper(TabContentsWrapper* wrapper);
+ virtual ~CoreTabHelper();
+
+ CoreTabHelperDelegate* delegate() const { return delegate_; }
+ void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; }
+
+ // Initial title assigned to NavigationEntries from Navigate.
+ static string16 GetDefaultTitle();
+
+ // Returns a human-readable description the tab's loading state.
+ string16 GetStatusText() const;
+
+ private:
+ // TabContentsObserver overrides:
+ virtual void DidBecomeSelected() OVERRIDE;
+
+ // content::NotificationObserver overrides:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ // Delegate for notifying our owner about stuff. Not owned by us.
+ CoreTabHelperDelegate* delegate_;
+
+ // Our owning TabContentsWrapper.
+ TabContentsWrapper* wrapper_;
+
+ PrefChangeRegistrar pref_change_registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(CoreTabHelper);
+};
+
+#endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698