| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/tab_contents/native_tab_contents_container_win.h" | 5 #include "chrome/browser/views/tab_contents/native_tab_contents_container_win.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 8 #include "chrome/browser/tab_contents/interstitial_page.h" | 8 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/browser/views/tab_contents/tab_contents_container.h" | 10 #include "chrome/browser/views/tab_contents/tab_contents_container.h" |
| 11 #include "chrome/browser/views/tab_contents/tab_contents_view_win.h" |
| 12 |
| 11 #include "views/focus/focus_manager.h" | 13 #include "views/focus/focus_manager.h" |
| 12 | 14 |
| 13 //////////////////////////////////////////////////////////////////////////////// | 15 //////////////////////////////////////////////////////////////////////////////// |
| 14 // NativeTabContentsContainerWin, public: | 16 // NativeTabContentsContainerWin, public: |
| 15 | 17 |
| 16 NativeTabContentsContainerWin::NativeTabContentsContainerWin( | 18 NativeTabContentsContainerWin::NativeTabContentsContainerWin( |
| 17 TabContentsContainer* container) | 19 TabContentsContainer* container) |
| 18 : container_(container) { | 20 : container_(container) { |
| 19 } | 21 } |
| 20 | 22 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 // TODO(brettw) should this move to NativeViewHost::Detach which is called | 39 // TODO(brettw) should this move to NativeViewHost::Detach which is called |
| 38 // below? | 40 // below? |
| 39 // It needs cleanup regardless. | 41 // It needs cleanup regardless. |
| 40 HWND container_hwnd = contents->GetNativeView(); | 42 HWND container_hwnd = contents->GetNativeView(); |
| 41 if (container_hwnd) { | 43 if (container_hwnd) { |
| 42 // Hide the contents before adjusting its parent to avoid a full desktop | 44 // Hide the contents before adjusting its parent to avoid a full desktop |
| 43 // flicker. | 45 // flicker. |
| 44 ShowWindow(container_hwnd, SW_HIDE); | 46 ShowWindow(container_hwnd, SW_HIDE); |
| 45 | 47 |
| 46 // Reset the parent to NULL to ensure hidden tabs don't receive messages. | 48 // Reset the parent to NULL to ensure hidden tabs don't receive messages. |
| 47 ::SetParent(container_hwnd, NULL); | 49 static_cast<TabContentsViewWin*>(contents->view())->Unparent(); |
| 48 } | 50 } |
| 49 | 51 |
| 50 // Now detach the TabContents. | 52 // Now detach the TabContents. |
| 51 Detach(); | 53 Detach(); |
| 52 } | 54 } |
| 53 | 55 |
| 54 void NativeTabContentsContainerWin::SetFastResize(bool fast_resize) { | 56 void NativeTabContentsContainerWin::SetFastResize(bool fast_resize) { |
| 55 set_fast_resize(fast_resize); | 57 set_fast_resize(fast_resize); |
| 56 } | 58 } |
| 57 | 59 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 130 } |
| 129 | 131 |
| 130 //////////////////////////////////////////////////////////////////////////////// | 132 //////////////////////////////////////////////////////////////////////////////// |
| 131 // NativeTabContentsContainer, public: | 133 // NativeTabContentsContainer, public: |
| 132 | 134 |
| 133 // static | 135 // static |
| 134 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( | 136 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( |
| 135 TabContentsContainer* container) { | 137 TabContentsContainer* container) { |
| 136 return new NativeTabContentsContainerWin(container); | 138 return new NativeTabContentsContainerWin(container); |
| 137 } | 139 } |
| OLD | NEW |