Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents_container.h" | 5 #include "chrome/browser/views/tab_contents/tab_contents_container.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_view_host.h" | 7 #include "chrome/browser/renderer_host/render_view_host.h" |
| 8 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 8 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 9 #include "chrome/browser/tab_contents/interstitial_page.h" | 9 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 | 31 |
| 32 TabContentsContainer::~TabContentsContainer() { | 32 TabContentsContainer::~TabContentsContainer() { |
| 33 if (tab_contents_) | 33 if (tab_contents_) |
| 34 RemoveObservers(); | 34 RemoveObservers(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void TabContentsContainer::ChangeTabContents(TabContents* contents) { | 37 void TabContentsContainer::ChangeTabContents(TabContents* contents) { |
| 38 if (tab_contents_) { | 38 if (tab_contents_) { |
| 39 #if !defined(TOUCH_UI) | 39 #if !defined(TOUCH_UI) |
| 40 native_container_->DetachContents(tab_contents_); | 40 native_container_->DetachContents(tab_contents_); |
| 41 #else | |
| 42 views::View *v = static_cast<TabContentsViewViews*>(tab_contents_->view()); | |
|
sky
2010/12/10 18:20:07
nit: View* v.
| |
| 43 RemoveChildView(v); | |
|
sky
2010/12/10 16:37:21
All these ifdefs are making this class unreadable
| |
| 41 #endif | 44 #endif |
| 42 tab_contents_->WasHidden(); | 45 tab_contents_->WasHidden(); |
| 43 RemoveObservers(); | 46 RemoveObservers(); |
| 44 } | 47 } |
| 45 #if !defined(TOUCH_UI) | 48 #if !defined(TOUCH_UI) |
| 46 TabContents* old_contents = tab_contents_; | 49 TabContents* old_contents = tab_contents_; |
| 47 #endif | 50 #endif |
| 48 tab_contents_ = contents; | 51 tab_contents_ = contents; |
| 49 // When detaching the last tab of the browser ChangeTabContents is invoked | 52 // When detaching the last tab of the browser ChangeTabContents is invoked |
| 50 // with NULL. Don't attempt to do anything in that case. | 53 // with NULL. Don't attempt to do anything in that case. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 void TabContentsContainer::RenderWidgetHostViewChanged( | 175 void TabContentsContainer::RenderWidgetHostViewChanged( |
| 173 RenderWidgetHostView* old_view, RenderWidgetHostView* new_view) { | 176 RenderWidgetHostView* old_view, RenderWidgetHostView* new_view) { |
| 174 // Carry over the reserved rect, if possible. | 177 // Carry over the reserved rect, if possible. |
| 175 if (old_view && new_view) { | 178 if (old_view && new_view) { |
| 176 new_view->set_reserved_contents_rect(old_view->reserved_contents_rect()); | 179 new_view->set_reserved_contents_rect(old_view->reserved_contents_rect()); |
| 177 } else { | 180 } else { |
| 178 if (reserved_area_delegate_) | 181 if (reserved_area_delegate_) |
| 179 reserved_area_delegate_->UpdateReservedContentsRect(this); | 182 reserved_area_delegate_->UpdateReservedContentsRect(this); |
| 180 } | 183 } |
| 181 } | 184 } |
| OLD | NEW |