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

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

Issue 1964133002: Convert set zoom calls to go through RenderView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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 4476 matching lines...) Expand 10 before | Expand all | Expand 10 after
4487 ZoomFactorToZoomLevel(kMinimumZoomFactor), 4487 ZoomFactorToZoomLevel(kMinimumZoomFactor),
4488 ZoomFactorToZoomLevel(kMaximumZoomFactor)); 4488 ZoomFactorToZoomLevel(kMaximumZoomFactor));
4489 4489
4490 // Set zoom level, but don't do it for full-page plugin since they don't use 4490 // Set zoom level, but don't do it for full-page plugin since they don't use
4491 // the same zoom settings. 4491 // the same zoom settings.
4492 HostZoomLevels::iterator host_zoom = 4492 HostZoomLevels::iterator host_zoom =
4493 render_view_->host_zoom_levels_.find(GURL(request.url())); 4493 render_view_->host_zoom_levels_.find(GURL(request.url()));
4494 if (render_view_->webview()->mainFrame()->isWebLocalFrame() && 4494 if (render_view_->webview()->mainFrame()->isWebLocalFrame() &&
4495 render_view_->webview()->mainFrame()->document().isPluginDocument()) { 4495 render_view_->webview()->mainFrame()->document().isPluginDocument()) {
4496 // Reset the zoom levels for plugins. 4496 // Reset the zoom levels for plugins.
4497 render_view_->webview()->setZoomLevel(0); 4497 render_view_->SetZoomLevel(0);
4498 } else { 4498 } else {
4499 // If the zoom level is not found, then do nothing. In-page navigation 4499 // If the zoom level is not found, then do nothing. In-page navigation
4500 // relies on not changing the zoom level in this case. 4500 // relies on not changing the zoom level in this case.
4501 if (host_zoom != render_view_->host_zoom_levels_.end()) 4501 if (host_zoom != render_view_->host_zoom_levels_.end())
4502 render_view_->webview()->setZoomLevel(host_zoom->second); 4502 render_view_->webview()->setZoomLevel(host_zoom->second);
4503 } 4503 }
4504 4504
4505 if (host_zoom != render_view_->host_zoom_levels_.end()) { 4505 if (host_zoom != render_view_->host_zoom_levels_.end()) {
4506 // This zoom level was merely recorded transiently for this load. We can 4506 // This zoom level was merely recorded transiently for this load. We can
4507 // erase it now. If at some point we reload this page, the browser will 4507 // erase it now. If at some point we reload this page, the browser will
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
4570 // mark it as such. 4570 // mark it as such.
4571 if (commit_type == blink::WebStandardCommit) 4571 if (commit_type == blink::WebStandardCommit)
4572 params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME; 4572 params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME;
4573 else 4573 else
4574 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; 4574 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME;
4575 4575
4576 DCHECK(!navigation_state->request_params().should_clear_history_list); 4576 DCHECK(!navigation_state->request_params().should_clear_history_list);
4577 params.history_list_was_cleared = false; 4577 params.history_list_was_cleared = false;
4578 params.report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT; 4578 params.report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT;
4579 // Subframes should match the zoom level of the main frame. 4579 // Subframes should match the zoom level of the main frame.
4580 render_view_->webview()->setZoomLevel(render_view_->page_zoom_level()); 4580 render_view_->SetZoomLevel(render_view_->page_zoom_level());
4581 } 4581 }
4582 4582
4583 // This message needs to be sent before any of allowScripts(), 4583 // This message needs to be sent before any of allowScripts(),
4584 // allowImages(), allowPlugins() is called for the new page, so that when 4584 // allowImages(), allowPlugins() is called for the new page, so that when
4585 // these functions send a ViewHostMsg_ContentBlocked message, it arrives 4585 // these functions send a ViewHostMsg_ContentBlocked message, it arrives
4586 // after the FrameHostMsg_DidCommitProvisionalLoad message. 4586 // after the FrameHostMsg_DidCommitProvisionalLoad message.
4587 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params)); 4587 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params));
4588 4588
4589 // If we end up reusing this WebRequest (for example, due to a #ref click), 4589 // If we end up reusing this WebRequest (for example, due to a #ref click),
4590 // we don't want the transition type to persist. Just clear it. 4590 // we don't want the transition type to persist. Just clear it.
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
6043 int match_count, 6043 int match_count,
6044 int ordinal, 6044 int ordinal,
6045 const WebRect& selection_rect, 6045 const WebRect& selection_rect,
6046 bool final_status_update) { 6046 bool final_status_update) {
6047 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6047 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6048 selection_rect, ordinal, 6048 selection_rect, ordinal,
6049 final_status_update)); 6049 final_status_update));
6050 } 6050 }
6051 6051
6052 } // namespace content 6052 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698