| 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/native_tab_contents_view_win.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
| 8 #include "chrome/browser/tab_contents/web_drop_target_win.h" | 8 #include "chrome/browser/tab_contents/web_drop_target_win.h" |
| 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" | 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" |
| 10 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h" | 10 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h" |
| 11 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" | 11 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" |
| 12 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
| 13 #include "content/browser/tab_contents/tab_contents_view.h" | 13 #include "content/browser/tab_contents/tab_contents_view.h" |
| 14 #include "views/views_delegate.h" |
| 14 #include "views/widget/widget.h" | 15 #include "views/widget/widget.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 // Tabs must be created as child widgets, otherwise they will be given | 19 // Tabs must be created as child widgets, otherwise they will be given |
| 19 // a FocusManager which will conflict with the FocusManager of the | 20 // a FocusManager which will conflict with the FocusManager of the |
| 20 // window they eventually end up attached to. | 21 // window they eventually end up attached to. |
| 21 // | 22 // |
| 22 // A tab will not have a parent HWND whenever it is not active in its | 23 // A tab will not have a parent HWND whenever it is not active in its |
| 23 // host window - for example at creation time and when it's in the | 24 // host window - for example at creation time and when it's in the |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 } | 336 } |
| 336 return false; | 337 return false; |
| 337 } | 338 } |
| 338 | 339 |
| 339 //////////////////////////////////////////////////////////////////////////////// | 340 //////////////////////////////////////////////////////////////////////////////// |
| 340 // NativeTabContentsView, public: | 341 // NativeTabContentsView, public: |
| 341 | 342 |
| 342 // static | 343 // static |
| 343 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( | 344 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( |
| 344 internal::NativeTabContentsViewDelegate* delegate) { | 345 internal::NativeTabContentsViewDelegate* delegate) { |
| 345 if (views::Widget::IsPureViews()) | 346 if (views::Widget::IsPureViews() && |
| 347 views::ViewsDelegate::views_delegate->GetDefaultParentView()) |
| 346 return new NativeTabContentsViewViews(delegate); | 348 return new NativeTabContentsViewViews(delegate); |
| 347 return new NativeTabContentsViewWin(delegate); | 349 return new NativeTabContentsViewWin(delegate); |
| 348 } | 350 } |
| OLD | NEW |