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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 | 1162 |
1163 RenderWidgetHostView* view = | 1163 RenderWidgetHostView* view = |
1164 RenderWidgetHostView::CreateViewForWidget(render_widget_host); | 1164 RenderWidgetHostView::CreateViewForWidget(render_widget_host); |
1165 view->InitAsChild(NULL); | 1165 view->InitAsChild(NULL); |
1166 GetNativeView()->AddChild(view->GetNativeView()); | 1166 GetNativeView()->AddChild(view->GetNativeView()); |
1167 | 1167 |
1168 if (navigation_overlay_.get() && navigation_overlay_->has_window()) { | 1168 if (navigation_overlay_.get() && navigation_overlay_->has_window()) { |
1169 navigation_overlay_->StartObservingView(ToRenderWidgetHostViewAura(view)); | 1169 navigation_overlay_->StartObservingView(ToRenderWidgetHostViewAura(view)); |
1170 } | 1170 } |
1171 | 1171 |
1172 view->Show(); | 1172 RenderWidgetHostImpl* host_impl = |
| 1173 RenderWidgetHostImpl::From(render_widget_host); |
| 1174 |
| 1175 if (!host_impl->is_hidden()) |
| 1176 view->Show(); |
1173 | 1177 |
1174 // We listen to drag drop events in the newly created view's window. | 1178 // We listen to drag drop events in the newly created view's window. |
1175 aura::client::SetDragDropDelegate(view->GetNativeView(), this); | 1179 aura::client::SetDragDropDelegate(view->GetNativeView(), this); |
1176 | 1180 |
1177 RenderWidgetHostImpl* host_impl = | |
1178 RenderWidgetHostImpl::From(render_widget_host); | |
1179 if (host_impl->overscroll_controller() && | 1181 if (host_impl->overscroll_controller() && |
1180 (!web_contents_->GetDelegate() || | 1182 (!web_contents_->GetDelegate() || |
1181 web_contents_->GetDelegate()->CanOverscrollContent())) { | 1183 web_contents_->GetDelegate()->CanOverscrollContent())) { |
1182 host_impl->overscroll_controller()->set_delegate(this); | 1184 host_impl->overscroll_controller()->set_delegate(this); |
1183 if (!navigation_overlay_) | 1185 if (!navigation_overlay_) |
1184 navigation_overlay_.reset(new OverscrollNavigationOverlay(web_contents_)); | 1186 navigation_overlay_.reset(new OverscrollNavigationOverlay(web_contents_)); |
1185 } | 1187 } |
1186 | 1188 |
1187 AttachTouchEditableToRenderView(); | 1189 AttachTouchEditableToRenderView(); |
1188 return view; | 1190 return view; |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 event.location(), | 1600 event.location(), |
1599 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1601 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
1600 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1602 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
1601 if (drag_dest_delegate_) | 1603 if (drag_dest_delegate_) |
1602 drag_dest_delegate_->OnDrop(); | 1604 drag_dest_delegate_->OnDrop(); |
1603 current_drop_data_.reset(); | 1605 current_drop_data_.reset(); |
1604 return current_drag_op_; | 1606 return current_drag_op_; |
1605 } | 1607 } |
1606 | 1608 |
1607 } // namespace content | 1609 } // namespace content |
OLD | NEW |