| 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/dom_view.h" | 5 #include "chrome/browser/ui/views/dom_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/renderer_preferences_util.h" | 8 #include "chrome/browser/renderer_preferences_util.h" |
| 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Attach the native_view when this is added to Widget if | 73 // Attach the native_view when this is added to Widget if |
| 74 // the native view has not been attached yet and tab_contents_ exists. | 74 // the native view has not been attached yet and tab_contents_ exists. |
| 75 views::NativeViewHost::ViewHierarchyChanged(is_add, parent, child); | 75 views::NativeViewHost::ViewHierarchyChanged(is_add, parent, child); |
| 76 if (is_add && GetWidget() && !native_view() && dom_contents_.get()) | 76 if (is_add && GetWidget() && !native_view() && dom_contents_.get()) |
| 77 AttachTabContents(); | 77 AttachTabContents(); |
| 78 else if (!is_add && child == this && native_view()) | 78 else if (!is_add && child == this && native_view()) |
| 79 Detach(); | 79 Detach(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void DOMView::AttachTabContents() { | 82 void DOMView::AttachTabContents() { |
| 83 #if !defined(USE_AURA) | 83 #if defined(TOUCH_UI) || !defined(USE_AURA) |
| 84 if (views::Widget::IsPureViews()) { | 84 if (views::Widget::IsPureViews()) { |
| 85 TabContentsViewViews* widget = static_cast<TabContentsViewViews*>( | 85 TabContentsViewViews* widget = static_cast<TabContentsViewViews*>( |
| 86 dom_contents_->tab_contents()->view()); | 86 dom_contents_->tab_contents()->view()); |
| 87 views::NativeWidgetViews* nwv = | 87 views::NativeWidgetViews* nwv = |
| 88 static_cast<views::NativeWidgetViews*>(widget->native_widget()); | 88 static_cast<views::NativeWidgetViews*>(widget->native_widget()); |
| 89 AttachToView(nwv->GetView()); | 89 AttachToView(nwv->GetView()); |
| 90 } else { | 90 } else { |
| 91 #endif | 91 #endif |
| 92 Attach(dom_contents_->tab_contents()->GetNativeView()); | 92 Attach(dom_contents_->tab_contents()->GetNativeView()); |
| 93 #if !defined(USE_AURA) | 93 #if defined(TOUCH_UI) || !defined(USE_AURA) |
| 94 } | 94 } |
| 95 #endif | 95 #endif |
| 96 } | 96 } |
| OLD | NEW |