| 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/instant/instant_unload_handler.h" | 5 #include "chrome/browser/instant/instant_unload_handler.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_view_host.h" | |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | |
| 9 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | |
| 10 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_navigator.h" | 8 #include "chrome/browser/ui/browser_navigator.h" |
| 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 10 #include "content/browser/renderer_host/render_view_host.h" |
| 11 #include "content/browser/tab_contents/tab_contents.h" |
| 12 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 13 | 13 |
| 14 // TabContentsDelegate implementation. This owns the TabContents supplied to the | 14 // TabContentsDelegate implementation. This owns the TabContents supplied to the |
| 15 // constructor. | 15 // constructor. |
| 16 class InstantUnloadHandler::TabContentsDelegateImpl | 16 class InstantUnloadHandler::TabContentsDelegateImpl |
| 17 : public TabContentsDelegate { | 17 : public TabContentsDelegate { |
| 18 public: | 18 public: |
| 19 TabContentsDelegateImpl(InstantUnloadHandler* handler, | 19 TabContentsDelegateImpl(InstantUnloadHandler* handler, |
| 20 TabContentsWrapper* tab_contents, | 20 TabContentsWrapper* tab_contents, |
| 21 int index) | 21 int index) |
| 22 : handler_(handler), | 22 : handler_(handler), |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Add the tab back in. | 125 // Add the tab back in. |
| 126 browser::Navigate(¶ms); | 126 browser::Navigate(¶ms); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void InstantUnloadHandler::Destroy(TabContentsDelegateImpl* delegate) { | 129 void InstantUnloadHandler::Destroy(TabContentsDelegateImpl* delegate) { |
| 130 ScopedVector<TabContentsDelegateImpl>::iterator i = | 130 ScopedVector<TabContentsDelegateImpl>::iterator i = |
| 131 std::find(delegates_.begin(), delegates_.end(), delegate); | 131 std::find(delegates_.begin(), delegates_.end(), delegate); |
| 132 DCHECK(i != delegates_.end()); | 132 DCHECK(i != delegates_.end()); |
| 133 delegates_.erase(i); | 133 delegates_.erase(i); |
| 134 } | 134 } |
| OLD | NEW |