summaryrefslogtreecommitdiffstats
path: root/chrome/common/temp_scaffolding_stubs.cc
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 21:04:46 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 21:04:46 +0000
commit7d886d12386ee44f2afd10ec47304135d0c4192b (patch)
treed06e04d969e3c148058c257522f7360ae26d056b /chrome/common/temp_scaffolding_stubs.cc
parent1ed7e00c6e9d9b757117ca51c652a5460b5b8d66 (diff)
downloadchromium_src-7d886d12386ee44f2afd10ec47304135d0c4192b.zip
chromium_src-7d886d12386ee44f2afd10ec47304135d0c4192b.tar.gz
chromium_src-7d886d12386ee44f2afd10ec47304135d0c4192b.tar.bz2
Hook up tab close menu item and plumb tab closing scaffolding through UI layer on Mac. Fix several unregistered prefs issues from other checkins.
Review URL: http://codereview.chromium.org/21092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/temp_scaffolding_stubs.cc')
-rw-r--r--chrome/common/temp_scaffolding_stubs.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc
index d652dee..d050cb7 100644
--- a/chrome/common/temp_scaffolding_stubs.cc
+++ b/chrome/common/temp_scaffolding_stubs.cc
@@ -184,6 +184,33 @@ Profile* TabContents::profile() const {
return controller_ ? controller_->profile() : NULL;
}
+void TabContents::CloseContents() {
+ // Destroy our NavigationController, which will Destroy all tabs it owns.
+ controller_->Destroy();
+ // Note that the controller may have deleted us at this point,
+ // so don't touch any member variables here.
+}
+
+void TabContents::Destroy() {
+ // TODO(pinkerton): this isn't the real version of Destroy(), just enough to
+ // get the scaffolding working.
+
+ // Notify any observer that have a reference on this tab contents.
+ NotificationService::current()->Notify(
+ NotificationType::TAB_CONTENTS_DESTROYED,
+ Source<TabContents>(this),
+ NotificationService::NoDetails());
+
+ // Notify our NavigationController. Make sure we are deleted first, so
+ // that the controller is the last to die.
+ NavigationController* controller = controller_;
+ TabContentsType type = this->type();
+
+ delete this;
+
+ controller->TabContentsWasDestroyed(type);
+}
+
//--------------------------------------------------------------------------
class RenderWidgetHostViewStub : public RenderWidgetHostView {