| 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/ui/constrained_window_tab_helper.h" | 5 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/constrained_window.h" | 7 #include "chrome/browser/ui/constrained_window.h" |
| 8 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" | 8 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 #include "content/browser/renderer_host/render_view_host.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
| 12 #include "content/browser/renderer_host/render_widget_host_view.h" | 12 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 13 #include "content/browser/tab_contents/navigation_details.h" | 13 #include "content/browser/tab_contents/navigation_details.h" |
| 14 #include "content/browser/tab_contents/tab_contents.h" |
| 14 #include "net/base/registry_controlled_domain.h" | 15 #include "net/base/registry_controlled_domain.h" |
| 15 | 16 |
| 16 ConstrainedWindowTabHelper::ConstrainedWindowTabHelper( | 17 ConstrainedWindowTabHelper::ConstrainedWindowTabHelper( |
| 17 TabContentsWrapper* wrapper) | 18 TabContentsWrapper* wrapper) |
| 18 : TabContentsObserver(wrapper->tab_contents()), | 19 : TabContentsObserver(wrapper->tab_contents()), |
| 19 wrapper_(wrapper), | 20 wrapper_(wrapper), |
| 20 delegate_(NULL) { | 21 delegate_(NULL) { |
| 21 } | 22 } |
| 22 | 23 |
| 23 ConstrainedWindowTabHelper::~ConstrainedWindowTabHelper() { | 24 ConstrainedWindowTabHelper::~ConstrainedWindowTabHelper() { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 101 } |
| 101 } | 102 } |
| 102 | 103 |
| 103 void ConstrainedWindowTabHelper::TabContentsDestroyed(TabContents* tab) { | 104 void ConstrainedWindowTabHelper::TabContentsDestroyed(TabContents* tab) { |
| 104 // First cleanly close all child windows. | 105 // First cleanly close all child windows. |
| 105 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked | 106 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked |
| 106 // some of these to close. CloseWindows is async, so it might get called | 107 // some of these to close. CloseWindows is async, so it might get called |
| 107 // twice before it runs. | 108 // twice before it runs. |
| 108 CloseConstrainedWindows(); | 109 CloseConstrainedWindows(); |
| 109 } | 110 } |
| OLD | NEW |