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/public/browser/site_instance.h" |
10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
11 #include "ui/views/focus/focus_manager.h" | 12 #include "ui/views/focus/focus_manager.h" |
12 | 13 |
| 14 using content::SiteInstance; |
13 using content::WebContents; | 15 using content::WebContents; |
14 | 16 |
15 // static | 17 // static |
16 const char DOMView::kViewClassName[] = | 18 const char DOMView::kViewClassName[] = |
17 "browser/ui/views/DOMView"; | 19 "browser/ui/views/DOMView"; |
18 | 20 |
19 DOMView::DOMView() : initialized_(false) { | 21 DOMView::DOMView() : initialized_(false) { |
20 set_focusable(true); | 22 set_focusable(true); |
21 } | 23 } |
22 | 24 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 views::NativeViewHost::ViewHierarchyChanged(is_add, parent, child); | 79 views::NativeViewHost::ViewHierarchyChanged(is_add, parent, child); |
78 if (is_add && GetWidget() && !native_view() && dom_contents_.get()) | 80 if (is_add && GetWidget() && !native_view() && dom_contents_.get()) |
79 AttachTabContents(); | 81 AttachTabContents(); |
80 else if (!is_add && child == this && native_view()) | 82 else if (!is_add && child == this && native_view()) |
81 Detach(); | 83 Detach(); |
82 } | 84 } |
83 | 85 |
84 void DOMView::AttachTabContents() { | 86 void DOMView::AttachTabContents() { |
85 Attach(dom_contents_->web_contents()->GetNativeView()); | 87 Attach(dom_contents_->web_contents()->GetNativeView()); |
86 } | 88 } |
OLD | NEW |