| 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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 expected_content_intent_id_(0), | 694 expected_content_intent_id_(0), |
| 695 #endif | 695 #endif |
| 696 enumeration_completion_id_(0), | 696 enumeration_completion_id_(0), |
| 697 session_storage_namespace_id_(params.session_storage_namespace_id), | 697 session_storage_namespace_id_(params.session_storage_namespace_id), |
| 698 has_added_input_handler_(false) { | 698 has_added_input_handler_(false) { |
| 699 GetWidget()->set_owner_delegate(this); | 699 GetWidget()->set_owner_delegate(this); |
| 700 } | 700 } |
| 701 | 701 |
| 702 void RenderViewImpl::Initialize(const mojom::CreateViewParams& params, | 702 void RenderViewImpl::Initialize(const mojom::CreateViewParams& params, |
| 703 bool was_created_by_renderer) { | 703 bool was_created_by_renderer) { |
| 704 SetRoutingID(params.view_id); | 704 int opener_view_routing_id = MSG_ROUTING_NONE; |
| 705 | |
| 706 int opener_view_routing_id; | |
| 707 WebFrame* opener_frame = RenderFrameImpl::ResolveOpener( | 705 WebFrame* opener_frame = RenderFrameImpl::ResolveOpener( |
| 708 params.opener_frame_route_id, &opener_view_routing_id); | 706 params.opener_frame_route_id, &opener_view_routing_id); |
| 709 if (opener_view_routing_id != MSG_ROUTING_NONE && was_created_by_renderer) | 707 if (!was_created_by_renderer) |
| 710 opener_id_ = opener_view_routing_id; | 708 opener_view_routing_id = MSG_ROUTING_NONE; |
| 711 | 709 |
| 712 display_mode_ = params.initial_size.display_mode; | 710 display_mode_ = params.initial_size.display_mode; |
| 713 | 711 |
| 712 // TODO(nick): Make sure that WebView::create doesn't need routing_id_ set. |
| 714 webview_ = | 713 webview_ = |
| 715 WebView::create(this, is_hidden() ? blink::WebPageVisibilityStateHidden | 714 WebView::create(this, is_hidden() ? blink::WebPageVisibilityStateHidden |
| 716 : blink::WebPageVisibilityStateVisible); | 715 : blink::WebPageVisibilityStateVisible); |
| 717 RenderWidget::DoInit(MSG_ROUTING_NONE, webview_->widget(), | 716 RenderWidget::Init(params.view_id, opener_view_routing_id, |
| 718 CreateWidgetCallback()); | 717 webview_->widget()); |
| 719 | 718 |
| 720 g_view_map.Get().insert(std::make_pair(webview(), this)); | 719 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| 721 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this)); | 720 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this)); |
| 722 | 721 |
| 723 const base::CommandLine& command_line = | 722 const base::CommandLine& command_line = |
| 724 *base::CommandLine::ForCurrentProcess(); | 723 *base::CommandLine::ForCurrentProcess(); |
| 725 | 724 |
| 726 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 725 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 727 stats_collection_observer_.reset(new StatsCollectionObserver(this)); | 726 stats_collection_observer_.reset(new StatsCollectionObserver(this)); |
| 728 | 727 |
| (...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3040 NotifyInputEventHandled(input_event->type, | 3039 NotifyInputEventHandled(input_event->type, |
| 3041 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 3040 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 3042 } | 3041 } |
| 3043 | 3042 |
| 3044 std::unique_ptr<InputEventAck> ack( | 3043 std::unique_ptr<InputEventAck> ack( |
| 3045 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 3044 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 3046 OnInputEventAck(std::move(ack)); | 3045 OnInputEventAck(std::move(ack)); |
| 3047 } | 3046 } |
| 3048 | 3047 |
| 3049 } // namespace content | 3048 } // namespace content |
| OLD | NEW |