| 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" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 TabContentsDestroyed(content::Source<TabContents>(source).ptr()); | 78 TabContentsDestroyed(content::Source<TabContents>(source).ptr()); |
| 79 } else { | 79 } else { |
| 80 NOTREACHED(); | 80 NOTREACHED(); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 //////////////////////////////////////////////////////////////////////////////// | 84 //////////////////////////////////////////////////////////////////////////////// |
| 85 // TabContentsContainer, View overrides: | 85 // TabContentsContainer, View overrides: |
| 86 | 86 |
| 87 void TabContentsContainer::Layout() { | 87 void TabContentsContainer::Layout() { |
| 88 if (native_container_) { | 88 if (native_container_) |
| 89 native_container_->GetView()->SetBounds(0, 0, width(), height()); | 89 native_container_->GetView()->SetBounds(0, 0, width(), height()); |
| 90 native_container_->GetView()->Layout(); | |
| 91 } | |
| 92 } | 90 } |
| 93 | 91 |
| 94 void TabContentsContainer::GetAccessibleState(ui::AccessibleViewState* state) { | 92 void TabContentsContainer::GetAccessibleState(ui::AccessibleViewState* state) { |
| 95 state->role = ui::AccessibilityTypes::ROLE_WINDOW; | 93 state->role = ui::AccessibilityTypes::ROLE_WINDOW; |
| 96 } | 94 } |
| 97 | 95 |
| 98 #if defined(HAVE_XINPUT2) | 96 #if defined(HAVE_XINPUT2) |
| 99 bool TabContentsContainer::OnMousePressed(const views::MouseEvent& event) { | 97 bool TabContentsContainer::OnMousePressed(const views::MouseEvent& event) { |
| 100 DCHECK(tab_contents_); | 98 DCHECK(tab_contents_); |
| 101 if (event.flags() & (ui::EF_LEFT_BUTTON_DOWN | | 99 if (event.flags() & (ui::EF_LEFT_BUTTON_DOWN | |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // us to clean up our state in case this happens. | 178 // us to clean up our state in case this happens. |
| 181 DCHECK(contents == tab_contents_); | 179 DCHECK(contents == tab_contents_); |
| 182 ChangeTabContents(NULL); | 180 ChangeTabContents(NULL); |
| 183 } | 181 } |
| 184 | 182 |
| 185 void TabContentsContainer::RenderWidgetHostViewChanged( | 183 void TabContentsContainer::RenderWidgetHostViewChanged( |
| 186 RenderWidgetHostView* new_view) { | 184 RenderWidgetHostView* new_view) { |
| 187 if (new_view) | 185 if (new_view) |
| 188 new_view->set_reserved_contents_rect(cached_reserved_rect_); | 186 new_view->set_reserved_contents_rect(cached_reserved_rect_); |
| 189 } | 187 } |
| OLD | NEW |