| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 // this actually is happening (and somebody isn't accidentally creating the | 879 // this actually is happening (and somebody isn't accidentally creating the |
| 880 // view twice), we check for the RVH Factory, which will be set when we're | 880 // view twice), we check for the RVH Factory, which will be set when we're |
| 881 // making special ones (which go along with the special views). | 881 // making special ones (which go along with the special views). |
| 882 DCHECK(RenderViewHostFactory::has_factory()); | 882 DCHECK(RenderViewHostFactory::has_factory()); |
| 883 return static_cast<RenderWidgetHostViewBase*>( | 883 return static_cast<RenderWidgetHostViewBase*>( |
| 884 render_widget_host->GetView()); | 884 render_widget_host->GetView()); |
| 885 } | 885 } |
| 886 | 886 |
| 887 RenderWidgetHostViewAura* view = | 887 RenderWidgetHostViewAura* view = |
| 888 new RenderWidgetHostViewAura(render_widget_host, is_guest_view_hack); | 888 new RenderWidgetHostViewAura(render_widget_host, is_guest_view_hack); |
| 889 view->InitAsChild(NULL); | 889 view->InitAsChild(GetNativeView()); |
| 890 GetNativeView()->AddChild(view->GetNativeView()); | |
| 891 | 890 |
| 892 RenderWidgetHostImpl* host_impl = | 891 RenderWidgetHostImpl* host_impl = |
| 893 RenderWidgetHostImpl::From(render_widget_host); | 892 RenderWidgetHostImpl::From(render_widget_host); |
| 894 | 893 |
| 895 if (!host_impl->is_hidden()) | 894 if (!host_impl->is_hidden()) |
| 896 view->Show(); | 895 view->Show(); |
| 897 | 896 |
| 898 // We listen to drag drop events in the newly created view's window. | 897 // We listen to drag drop events in the newly created view's window. |
| 899 aura::client::SetDragDropDelegate(view->GetNativeView(), this); | 898 aura::client::SetDragDropDelegate(view->GetNativeView(), this); |
| 900 | 899 |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 if (visible) { | 1319 if (visible) { |
| 1321 if (!web_contents_->should_normally_be_visible()) | 1320 if (!web_contents_->should_normally_be_visible()) |
| 1322 web_contents_->WasShown(); | 1321 web_contents_->WasShown(); |
| 1323 } else { | 1322 } else { |
| 1324 if (web_contents_->should_normally_be_visible()) | 1323 if (web_contents_->should_normally_be_visible()) |
| 1325 web_contents_->WasHidden(); | 1324 web_contents_->WasHidden(); |
| 1326 } | 1325 } |
| 1327 } | 1326 } |
| 1328 | 1327 |
| 1329 } // namespace content | 1328 } // namespace content |
| OLD | NEW |