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/tab_contents_container.h" | 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.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/native_tab_contents_container.h" | 8 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h" |
9 #include "content/browser/renderer_host/render_view_host.h" | 9 #include "content/browser/renderer_host/render_view_host.h" |
10 #include "content/browser/renderer_host/render_widget_host_view.h" | 10 #include "content/browser/renderer_host/render_widget_host_view.h" |
11 #include "content/browser/tab_contents/interstitial_page.h" | 11 #include "content/browser/tab_contents/interstitial_page.h" |
12 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
13 #include "content/common/notification_details.h" | 13 #include "content/common/notification_details.h" |
14 #include "content/common/notification_source.h" | 14 #include "content/common/notification_source.h" |
15 | 15 |
16 // Some of this class is implemented in tab_contents_container.cc, where | 16 // Some of this class is implemented in tab_contents_container.cc, where |
17 // the implementation doesn't vary between a pure views approach and a | 17 // the implementation doesn't vary between a pure views approach and a |
18 // native view host approach. See the header file for details. | 18 // native view host approach. See the header file for details. |
19 | 19 |
20 //////////////////////////////////////////////////////////////////////////////// | 20 //////////////////////////////////////////////////////////////////////////////// |
21 // TabContentsContainer, public: | 21 // TabContentsContainer, public: |
22 | 22 |
23 TabContentsContainer::TabContentsContainer() | 23 TabContentsContainer::TabContentsContainer() |
24 : native_container_(NULL), | 24 : native_container_(NULL), |
25 tab_contents_(NULL) { | 25 tab_contents_(NULL) { |
26 SetID(VIEW_ID_TAB_CONTAINER); | 26 set_id(VIEW_ID_TAB_CONTAINER); |
27 } | 27 } |
28 | 28 |
29 void TabContentsContainer::SetReservedContentsRect( | 29 void TabContentsContainer::SetReservedContentsRect( |
30 const gfx::Rect& reserved_rect) { | 30 const gfx::Rect& reserved_rect) { |
31 cached_reserved_rect_ = reserved_rect; | 31 cached_reserved_rect_ = reserved_rect; |
32 if (tab_contents_ && tab_contents_->GetRenderWidgetHostView()) { | 32 if (tab_contents_ && tab_contents_->GetRenderWidgetHostView()) { |
33 tab_contents_->GetRenderWidgetHostView()->set_reserved_contents_rect( | 33 tab_contents_->GetRenderWidgetHostView()->set_reserved_contents_rect( |
34 reserved_rect); | 34 reserved_rect); |
35 } | 35 } |
36 } | 36 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 //////////////////////////////////////////////////////////////////////////////// | 81 //////////////////////////////////////////////////////////////////////////////// |
82 // TabContentsContainer, private: | 82 // TabContentsContainer, private: |
83 | 83 |
84 void TabContentsContainer::RenderViewHostChanged(RenderViewHost* old_host, | 84 void TabContentsContainer::RenderViewHostChanged(RenderViewHost* old_host, |
85 RenderViewHost* new_host) { | 85 RenderViewHost* new_host) { |
86 if (new_host) | 86 if (new_host) |
87 RenderWidgetHostViewChanged(new_host->view()); | 87 RenderWidgetHostViewChanged(new_host->view()); |
88 native_container_->RenderViewHostChanged(old_host, new_host); | 88 native_container_->RenderViewHostChanged(old_host, new_host); |
89 } | 89 } |
OLD | NEW |