Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2417783005: [Master/Overview CL] Make PageScaleFactor work for oopif subframe.
Patch Set: Rebase to master@{#429656}. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 const blink::WebURL& url) { 1076 const blink::WebURL& url) {
1077 return GetContentClient()->renderer()->OverrideFlashEmbedWithHTML(url); 1077 return GetContentClient()->renderer()->OverrideFlashEmbedWithHTML(url);
1078 } 1078 }
1079 1079
1080 // RenderFrameImpl ---------------------------------------------------------- 1080 // RenderFrameImpl ----------------------------------------------------------
1081 RenderFrameImpl::RenderFrameImpl(const CreateParams& params) 1081 RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
1082 : frame_(NULL), 1082 : frame_(NULL),
1083 is_main_frame_(true), 1083 is_main_frame_(true),
1084 in_browser_initiated_detach_(false), 1084 in_browser_initiated_detach_(false),
1085 in_frame_tree_(false), 1085 in_frame_tree_(false),
1086 render_view_(params.render_view->AsWeakPtr()), 1086 render_view_(params.render_view),
1087 routing_id_(params.routing_id), 1087 routing_id_(params.routing_id),
1088 proxy_routing_id_(MSG_ROUTING_NONE), 1088 proxy_routing_id_(MSG_ROUTING_NONE),
1089 #if defined(ENABLE_PLUGINS) 1089 #if defined(ENABLE_PLUGINS)
1090 plugin_power_saver_helper_(nullptr), 1090 plugin_power_saver_helper_(nullptr),
1091 plugin_find_handler_(nullptr), 1091 plugin_find_handler_(nullptr),
1092 #endif 1092 #endif
1093 cookie_jar_(this), 1093 cookie_jar_(this),
1094 selection_text_offset_(0), 1094 selection_text_offset_(0),
1095 selection_range_(gfx::Range::InvalidRange()), 1095 selection_range_(gfx::Range::InvalidRange()),
1096 handling_select_range_(false), 1096 handling_select_range_(false),
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 // Synchronously run the unload handler before sending the ACK. 1728 // Synchronously run the unload handler before sending the ACK.
1729 // TODO(creis): Call dispatchUnloadEvent unconditionally here to support 1729 // TODO(creis): Call dispatchUnloadEvent unconditionally here to support
1730 // unload on subframes as well. 1730 // unload on subframes as well.
1731 if (is_main_frame_) 1731 if (is_main_frame_)
1732 frame_->dispatchUnloadEvent(); 1732 frame_->dispatchUnloadEvent();
1733 1733
1734 // Swap out and stop sending any IPC messages that are not ACKs. 1734 // Swap out and stop sending any IPC messages that are not ACKs.
1735 if (is_main_frame_) 1735 if (is_main_frame_)
1736 render_view_->SetSwappedOut(true); 1736 render_view_->SetSwappedOut(true);
1737 1737
1738 RenderViewImpl* render_view = render_view_.get(); 1738 RenderViewImpl* render_view = render_view_;
1739 bool is_main_frame = is_main_frame_; 1739 bool is_main_frame = is_main_frame_;
1740 int routing_id = GetRoutingID(); 1740 int routing_id = GetRoutingID();
1741 1741
1742 // Now that all of the cleanup is complete and the browser side is notified, 1742 // Now that all of the cleanup is complete and the browser side is notified,
1743 // start using the RenderFrameProxy. 1743 // start using the RenderFrameProxy.
1744 // 1744 //
1745 // The swap call deletes this RenderFrame via frameDetached. Do not access 1745 // The swap call deletes this RenderFrame via frameDetached. Do not access
1746 // any members after this call. 1746 // any members after this call.
1747 // 1747 //
1748 // TODO(creis): WebFrame::swap() can return false. Most of those cases 1748 // TODO(creis): WebFrame::swap() can return false. Most of those cases
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
2407 // similar precautions. 2407 // similar precautions.
2408 PepperPluginSet plugins = active_pepper_instances_; 2408 PepperPluginSet plugins = active_pepper_instances_;
2409 for (auto* plugin : plugins) { 2409 for (auto* plugin : plugins) {
2410 if (active_pepper_instances_.find(plugin) != active_pepper_instances_.end()) 2410 if (active_pepper_instances_.find(plugin) != active_pepper_instances_.end())
2411 plugin->ViewInitiatedPaint(); 2411 plugin->ViewInitiatedPaint();
2412 } 2412 }
2413 #endif 2413 #endif
2414 } 2414 }
2415 2415
2416 RenderView* RenderFrameImpl::GetRenderView() { 2416 RenderView* RenderFrameImpl::GetRenderView() {
2417 return render_view_.get(); 2417 return render_view_;
2418 } 2418 }
2419 2419
2420 RenderAccessibility* RenderFrameImpl::GetRenderAccessibility() { 2420 RenderAccessibility* RenderFrameImpl::GetRenderAccessibility() {
2421 return render_accessibility_; 2421 return render_accessibility_;
2422 } 2422 }
2423 2423
2424 int RenderFrameImpl::GetRoutingID() { 2424 int RenderFrameImpl::GetRoutingID() {
2425 return routing_id_; 2425 return routing_id_;
2426 } 2426 }
2427 2427
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 2981
2982 // This method is always called by local frames, never remote frames. 2982 // This method is always called by local frames, never remote frames.
2983 2983
2984 // Tracing analysis uses this to find main frames when this value is 2984 // Tracing analysis uses this to find main frames when this value is
2985 // MSG_ROUTING_NONE, and build the frame tree otherwise. 2985 // MSG_ROUTING_NONE, and build the frame tree otherwise.
2986 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::createChildFrame", 2986 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::createChildFrame",
2987 "id", routing_id_, 2987 "id", routing_id_,
2988 "child", child_routing_id); 2988 "child", child_routing_id);
2989 2989
2990 // Create the RenderFrame and WebLocalFrame, linking the two. 2990 // Create the RenderFrame and WebLocalFrame, linking the two.
2991 RenderFrameImpl* child_render_frame = RenderFrameImpl::Create( 2991 RenderFrameImpl* child_render_frame =
2992 render_view_.get(), child_routing_id); 2992 RenderFrameImpl::Create(render_view_, child_routing_id);
2993 child_render_frame->InitializeBlameContext(this); 2993 child_render_frame->InitializeBlameContext(this);
2994 blink::WebLocalFrame* web_frame = 2994 blink::WebLocalFrame* web_frame =
2995 WebLocalFrame::create(scope, child_render_frame); 2995 WebLocalFrame::create(scope, child_render_frame);
2996 child_render_frame->BindToWebFrame(web_frame); 2996 child_render_frame->BindToWebFrame(web_frame);
2997 2997
2998 // Add the frame to the frame tree and initialize it. 2998 // Add the frame to the frame tree and initialize it.
2999 parent->appendChild(web_frame); 2999 parent->appendChild(web_frame);
3000 child_render_frame->in_frame_tree_ = true; 3000 child_render_frame->in_frame_tree_ = true;
3001 child_render_frame->Initialize(); 3001 child_render_frame->Initialize();
3002 3002
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
4399 } 4399 }
4400 4400
4401 void RenderFrameImpl::didChangeScrollOffset(blink::WebLocalFrame* frame) { 4401 void RenderFrameImpl::didChangeScrollOffset(blink::WebLocalFrame* frame) {
4402 DCHECK_EQ(frame_, frame); 4402 DCHECK_EQ(frame_, frame);
4403 render_view_->StartNavStateSyncTimerIfNecessary(this); 4403 render_view_->StartNavStateSyncTimerIfNecessary(this);
4404 4404
4405 for (auto& observer : observers_) 4405 for (auto& observer : observers_)
4406 observer.DidChangeScrollOffset(); 4406 observer.DidChangeScrollOffset();
4407 } 4407 }
4408 4408
4409 void RenderFrameImpl::didRestorePageScaleFactorOnLoad(float page_scale) {
4410 // Notify the web contents so it can update cross-process frames.
4411 Send(new FrameHostMsg_RestorePageScaleFactorOnLoad(routing_id_, page_scale));
4412 }
4413
4409 void RenderFrameImpl::willInsertBody(blink::WebLocalFrame* frame) { 4414 void RenderFrameImpl::willInsertBody(blink::WebLocalFrame* frame) {
4410 DCHECK(!frame_ || frame_ == frame); 4415 DCHECK(!frame_ || frame_ == frame);
4411 if (!frame->parent()) { 4416 if (!frame->parent()) {
4412 render_view_->Send(new ViewHostMsg_WillInsertBody( 4417 render_view_->Send(new ViewHostMsg_WillInsertBody(
4413 render_view_->GetRoutingID())); 4418 render_view_->GetRoutingID()));
4414 } 4419 }
4415 } 4420 }
4416 4421
4417 void RenderFrameImpl::reportFindInPageMatchCount(int request_id, 4422 void RenderFrameImpl::reportFindInPageMatchCount(int request_id,
4418 int count, 4423 int count,
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after
6574 // event target. Potentially a Pepper plugin will receive the event. 6579 // event target. Potentially a Pepper plugin will receive the event.
6575 // In order to tell whether a plugin gets the last mouse event and which it 6580 // In order to tell whether a plugin gets the last mouse event and which it
6576 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6581 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6577 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6582 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6578 // |pepper_last_mouse_event_target_|. 6583 // |pepper_last_mouse_event_target_|.
6579 pepper_last_mouse_event_target_ = nullptr; 6584 pepper_last_mouse_event_target_ = nullptr;
6580 #endif 6585 #endif
6581 } 6586 }
6582 6587
6583 } // namespace content 6588 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698