| 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/views/tab_contents/native_tab_contents_container_gtk
.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk
.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/view_ids.h" | 7 #include "chrome/browser/ui/view_ids.h" |
| 8 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 8 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
| 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 9 #include "content/browser/renderer_host/render_widget_host_view.h" | 10 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 10 #include "content/browser/tab_contents/interstitial_page.h" | 11 #include "content/browser/tab_contents/interstitial_page.h" |
| 11 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
| 12 #include "ui/base/accessibility/accessible_view_state.h" | 13 #include "ui/base/accessibility/accessible_view_state.h" |
| 13 #include "views/focus/focus_manager.h" | 14 #include "views/focus/focus_manager.h" |
| 14 | 15 |
| 15 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 16 // NativeTabContentsContainerGtk, public: | 17 // NativeTabContentsContainerGtk, public: |
| 17 | 18 |
| 18 NativeTabContentsContainerGtk::NativeTabContentsContainerGtk( | 19 NativeTabContentsContainerGtk::NativeTabContentsContainerGtk( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 | 31 |
| 31 void NativeTabContentsContainerGtk::AttachContents(TabContents* contents) { | 32 void NativeTabContentsContainerGtk::AttachContents(TabContents* contents) { |
| 32 Attach(contents->GetNativeView()); | 33 Attach(contents->GetNativeView()); |
| 33 } | 34 } |
| 34 | 35 |
| 35 void NativeTabContentsContainerGtk::DetachContents(TabContents* contents) { | 36 void NativeTabContentsContainerGtk::DetachContents(TabContents* contents) { |
| 36 gtk_widget_hide(contents->GetNativeView()); | 37 gtk_widget_hide(contents->GetNativeView()); |
| 37 | 38 |
| 38 // Now detach the TabContents. | 39 // Now detach the TabContents. |
| 39 Detach(); | 40 Detach(); |
| 41 |
| 42 static_cast<TabContentsViewViews*>(contents->view())->Unparent(); |
| 40 } | 43 } |
| 41 | 44 |
| 42 void NativeTabContentsContainerGtk::SetFastResize(bool fast_resize) { | 45 void NativeTabContentsContainerGtk::SetFastResize(bool fast_resize) { |
| 43 set_fast_resize(fast_resize); | 46 set_fast_resize(fast_resize); |
| 44 } | 47 } |
| 45 | 48 |
| 46 void NativeTabContentsContainerGtk::RenderViewHostChanged( | 49 void NativeTabContentsContainerGtk::RenderViewHostChanged( |
| 47 RenderViewHost* old_host, | 50 RenderViewHost* old_host, |
| 48 RenderViewHost* new_host) { | 51 RenderViewHost* new_host) { |
| 49 // If we are focused, we need to pass the focus to the new RenderViewHost. | 52 // If we are focused, we need to pass the focus to the new RenderViewHost. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 140 } |
| 138 | 141 |
| 139 //////////////////////////////////////////////////////////////////////////////// | 142 //////////////////////////////////////////////////////////////////////////////// |
| 140 // NativeTabContentsContainer, public: | 143 // NativeTabContentsContainer, public: |
| 141 | 144 |
| 142 // static | 145 // static |
| 143 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( | 146 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( |
| 144 TabContentsContainer* container) { | 147 TabContentsContainer* container) { |
| 145 return new NativeTabContentsContainerGtk(container); | 148 return new NativeTabContentsContainerGtk(container); |
| 146 } | 149 } |
| OLD | NEW |