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 #include "chrome/browser/prerender/prerender_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 class PrerenderManager::OnCloseTabContentsDeleter : public TabContentsDelegate { | 73 class PrerenderManager::OnCloseTabContentsDeleter : public TabContentsDelegate { |
74 public: | 74 public: |
75 OnCloseTabContentsDeleter(PrerenderManager* manager, | 75 OnCloseTabContentsDeleter(PrerenderManager* manager, |
76 TabContentsWrapper* tab) | 76 TabContentsWrapper* tab) |
77 : manager_(manager), | 77 : manager_(manager), |
78 tab_(tab) { | 78 tab_(tab) { |
79 tab_->tab_contents()->set_delegate(this); | 79 tab_->tab_contents()->set_delegate(this); |
80 } | 80 } |
81 | 81 |
82 virtual void CloseContents(TabContents* source) OVERRIDE { | 82 virtual void CloseContents(TabContents* source) OVERRIDE { |
| 83 tab_->tab_contents()->set_delegate(NULL); |
83 manager_->ScheduleDeleteOldTabContents(tab_.release(), this); | 84 manager_->ScheduleDeleteOldTabContents(tab_.release(), this); |
84 } | 85 } |
85 | 86 |
86 virtual bool ShouldSuppressDialogs() OVERRIDE { | 87 virtual bool ShouldSuppressDialogs() OVERRIDE { |
87 return true; | 88 return true; |
88 } | 89 } |
89 | 90 |
90 // TabContentsDelegate implementation (pure virtual methods). Since we are | 91 // TabContentsDelegate implementation (pure virtual methods). Since we are |
91 // waiting for the tab to close, none of this matters. | 92 // waiting for the tab to close, none of this matters. |
92 virtual void OpenURLFromTab(TabContents*, const GURL&, const GURL&, | 93 virtual void OpenURLFromTab(TabContents*, const GURL&, const GURL&, |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 ScopedVector<OnCloseTabContentsDeleter>::iterator i = std::find( | 977 ScopedVector<OnCloseTabContentsDeleter>::iterator i = std::find( |
977 on_close_tab_contents_deleters_.begin(), | 978 on_close_tab_contents_deleters_.begin(), |
978 on_close_tab_contents_deleters_.end(), | 979 on_close_tab_contents_deleters_.end(), |
979 deleter); | 980 deleter); |
980 DCHECK(i != on_close_tab_contents_deleters_.end()); | 981 DCHECK(i != on_close_tab_contents_deleters_.end()); |
981 on_close_tab_contents_deleters_.erase(i); | 982 on_close_tab_contents_deleters_.erase(i); |
982 } | 983 } |
983 } | 984 } |
984 | 985 |
985 } // namespace prerender | 986 } // namespace prerender |
OLD | NEW |