| 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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 expected_content_intent_id_(0), | 690 expected_content_intent_id_(0), |
| 691 #endif | 691 #endif |
| 692 enumeration_completion_id_(0), | 692 enumeration_completion_id_(0), |
| 693 session_storage_namespace_id_(params.session_storage_namespace_id), | 693 session_storage_namespace_id_(params.session_storage_namespace_id), |
| 694 has_added_input_handler_(false) { | 694 has_added_input_handler_(false) { |
| 695 GetWidget()->set_owner_delegate(this); | 695 GetWidget()->set_owner_delegate(this); |
| 696 } | 696 } |
| 697 | 697 |
| 698 void RenderViewImpl::Initialize(const mojom::CreateViewParams& params, | 698 void RenderViewImpl::Initialize(const mojom::CreateViewParams& params, |
| 699 bool was_created_by_renderer) { | 699 bool was_created_by_renderer) { |
| 700 SetRoutingID(params.view_id); | 700 RenderWidget::InitRoutingID(params.view_id); |
| 701 | 701 |
| 702 int opener_view_routing_id; | 702 int opener_view_routing_id = MSG_ROUTING_NONE; |
| 703 WebFrame* opener_frame = RenderFrameImpl::ResolveOpener( | 703 WebFrame* opener_frame = RenderFrameImpl::ResolveOpener( |
| 704 params.opener_frame_route_id, &opener_view_routing_id); | 704 params.opener_frame_route_id, &opener_view_routing_id); |
| 705 if (opener_view_routing_id != MSG_ROUTING_NONE && was_created_by_renderer) | 705 if (!was_created_by_renderer) |
| 706 opener_id_ = opener_view_routing_id; | 706 opener_view_routing_id = MSG_ROUTING_NONE; |
| 707 | 707 |
| 708 display_mode_ = params.initial_size.display_mode; | 708 display_mode_ = params.initial_size.display_mode; |
| 709 | 709 |
| 710 webview_ = | 710 webview_ = |
| 711 WebView::create(this, is_hidden() ? blink::WebPageVisibilityStateHidden | 711 WebView::create(this, is_hidden() ? blink::WebPageVisibilityStateHidden |
| 712 : blink::WebPageVisibilityStateVisible); | 712 : blink::WebPageVisibilityStateVisible); |
| 713 RenderWidget::DoInit(MSG_ROUTING_NONE, webview_->widget(), | 713 RenderWidget::Init(opener_view_routing_id, webview_->widget()); |
| 714 CreateWidgetCallback()); | |
| 715 | 714 |
| 716 g_view_map.Get().insert(std::make_pair(webview(), this)); | 715 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| 717 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this)); | 716 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this)); |
| 718 | 717 |
| 719 const base::CommandLine& command_line = | 718 const base::CommandLine& command_line = |
| 720 *base::CommandLine::ForCurrentProcess(); | 719 *base::CommandLine::ForCurrentProcess(); |
| 721 | 720 |
| 722 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 721 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 723 stats_collection_observer_.reset(new StatsCollectionObserver(this)); | 722 stats_collection_observer_.reset(new StatsCollectionObserver(this)); |
| 724 | 723 |
| (...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2995 NotifyInputEventHandled(input_event->type, | 2994 NotifyInputEventHandled(input_event->type, |
| 2996 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2995 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2997 } | 2996 } |
| 2998 | 2997 |
| 2999 std::unique_ptr<InputEventAck> ack( | 2998 std::unique_ptr<InputEventAck> ack( |
| 3000 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2999 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 3001 OnInputEventAck(std::move(ack)); | 3000 OnInputEventAck(std::move(ack)); |
| 3002 } | 3001 } |
| 3003 | 3002 |
| 3004 } // namespace content | 3003 } // namespace content |
| OLD | NEW |