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

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

Issue 1953503005: RenderView needs to know zoom level for loading pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug/test not relevant to Android, don't try to run test there. Created 4 years, 7 months 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
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 4466 matching lines...) Expand 10 before | Expand all | Expand 10 after
4477 ZoomFactorToZoomLevel(kMinimumZoomFactor), 4477 ZoomFactorToZoomLevel(kMinimumZoomFactor),
4478 ZoomFactorToZoomLevel(kMaximumZoomFactor)); 4478 ZoomFactorToZoomLevel(kMaximumZoomFactor));
4479 4479
4480 // Set zoom level, but don't do it for full-page plugin since they don't use 4480 // Set zoom level, but don't do it for full-page plugin since they don't use
4481 // the same zoom settings. 4481 // the same zoom settings.
4482 HostZoomLevels::iterator host_zoom = 4482 HostZoomLevels::iterator host_zoom =
4483 render_view_->host_zoom_levels_.find(GURL(request.url())); 4483 render_view_->host_zoom_levels_.find(GURL(request.url()));
4484 if (render_view_->webview()->mainFrame()->isWebLocalFrame() && 4484 if (render_view_->webview()->mainFrame()->isWebLocalFrame() &&
4485 render_view_->webview()->mainFrame()->document().isPluginDocument()) { 4485 render_view_->webview()->mainFrame()->document().isPluginDocument()) {
4486 // Reset the zoom levels for plugins. 4486 // Reset the zoom levels for plugins.
4487 render_view_->webview()->setZoomLevel(0); 4487 render_view_->webview()->setZoomLevel(0);
Charlie Reis 2016/05/10 17:15:49 What about this one?
wjmaclean 2016/05/10 17:52:41 This one is right, since presumably the plugin doc
4488 } else { 4488 } else {
4489 // If the zoom level is not found, then do nothing. In-page navigation 4489 // If the zoom level is not found, then do nothing. In-page navigation
4490 // relies on not changing the zoom level in this case. 4490 // relies on not changing the zoom level in this case.
4491 if (host_zoom != render_view_->host_zoom_levels_.end()) 4491 if (host_zoom != render_view_->host_zoom_levels_.end())
4492 render_view_->webview()->setZoomLevel(host_zoom->second); 4492 render_view_->SetZoomLevel(host_zoom->second);
4493 } 4493 }
4494 4494
4495 if (host_zoom != render_view_->host_zoom_levels_.end()) { 4495 if (host_zoom != render_view_->host_zoom_levels_.end()) {
4496 // This zoom level was merely recorded transiently for this load. We can 4496 // This zoom level was merely recorded transiently for this load. We can
4497 // erase it now. If at some point we reload this page, the browser will 4497 // erase it now. If at some point we reload this page, the browser will
4498 // send us a new, up-to-date zoom level. 4498 // send us a new, up-to-date zoom level.
4499 render_view_->host_zoom_levels_.erase(host_zoom); 4499 render_view_->host_zoom_levels_.erase(host_zoom);
4500 } 4500 }
4501 4501
4502 // Update contents MIME type for main frame. 4502 // Update contents MIME type for main frame.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
4560 // mark it as such. 4560 // mark it as such.
4561 if (commit_type == blink::WebStandardCommit) 4561 if (commit_type == blink::WebStandardCommit)
4562 params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME; 4562 params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME;
4563 else 4563 else
4564 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; 4564 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME;
4565 4565
4566 DCHECK(!navigation_state->request_params().should_clear_history_list); 4566 DCHECK(!navigation_state->request_params().should_clear_history_list);
4567 params.history_list_was_cleared = false; 4567 params.history_list_was_cleared = false;
4568 params.report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT; 4568 params.report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT;
4569 // Subframes should match the zoom level of the main frame. 4569 // Subframes should match the zoom level of the main frame.
4570 render_view_->webview()->setZoomLevel(render_view_->page_zoom_level()); 4570 render_view_->webview()->setZoomLevel(render_view_->page_zoom_level());
Charlie Reis 2016/05/10 17:15:49 Is this one right?
wjmaclean 2016/05/10 17:52:41 This is right since it is using the page_zoom_leve
4571 } 4571 }
4572 4572
4573 // This message needs to be sent before any of allowScripts(), 4573 // This message needs to be sent before any of allowScripts(),
4574 // allowImages(), allowPlugins() is called for the new page, so that when 4574 // allowImages(), allowPlugins() is called for the new page, so that when
4575 // these functions send a ViewHostMsg_ContentBlocked message, it arrives 4575 // these functions send a ViewHostMsg_ContentBlocked message, it arrives
4576 // after the FrameHostMsg_DidCommitProvisionalLoad message. 4576 // after the FrameHostMsg_DidCommitProvisionalLoad message.
4577 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params)); 4577 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params));
4578 4578
4579 // If we end up reusing this WebRequest (for example, due to a #ref click), 4579 // If we end up reusing this WebRequest (for example, due to a #ref click),
4580 // we don't want the transition type to persist. Just clear it. 4580 // we don't want the transition type to persist. Just clear it.
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
6033 int match_count, 6033 int match_count,
6034 int ordinal, 6034 int ordinal,
6035 const WebRect& selection_rect, 6035 const WebRect& selection_rect,
6036 bool final_status_update) { 6036 bool final_status_update) {
6037 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6037 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6038 selection_rect, ordinal, 6038 selection_rect, ordinal,
6039 final_status_update)); 6039 final_status_update));
6040 } 6040 }
6041 6041
6042 } // namespace content 6042 } // namespace content
OLDNEW
« content/browser/iframe_zoom_browsertest.cc ('K') | « content/browser/iframe_zoom_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698