Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index b6542ffbd6a27e3a63ea96e4858bb8f0a758a83b..18b3b64377edd066d790c32c573a74e4eae87f75 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -647,6 +647,7 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) |
| history_list_length_(0), |
| frames_in_progress_(0), |
| target_url_status_(TARGET_NONE), |
| + uses_temporary_zoom_level_(false), |
| #if defined(OS_ANDROID) |
| top_controls_constraints_(cc::BOTH), |
| #endif |
| @@ -675,8 +676,7 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) |
| #endif |
| enumeration_completion_id_(0), |
| session_storage_namespace_id_(params->session_storage_namespace_id), |
| - next_snapshot_id_(0) { |
| -} |
| + next_snapshot_id_(0) {} |
| void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
| routing_id_ = params->routing_id; |
| @@ -1079,6 +1079,10 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) { |
| IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
| IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
| OnSetZoomLevelForLoadingURL) |
| + IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, |
| + OnSetZoomLevelForView) |
| + IPC_MESSAGE_HANDLER(ViewMsg_SetUsesTemporaryZoomLevel, |
| + OnSetUsesTemporaryZoomLevel) |
| IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) |
| IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, |
| OnResetPageEncodingToDefault) |
| @@ -1956,6 +1960,15 @@ const std::string& RenderViewImpl::GetAcceptLanguages() const { |
| return renderer_preferences_.accept_languages; |
| } |
| +bool RenderViewImpl::UsesTemporaryZoomLevel() const { |
|
Fady Samuel
2014/06/10 20:05:14
This doesn't need to be in the content API.
|
| + return uses_temporary_zoom_level_; |
| +} |
| + |
| +void RenderViewImpl::set_uses_temporary_zoom_level( |
| + bool uses_temporary_zoom_level) { |
| + uses_temporary_zoom_level_ = uses_temporary_zoom_level; |
|
Fady Samuel
2014/06/10 20:05:14
Move this trivial accessor to the render_view_impl
wjmaclean
2014/06/10 20:18:55
Done.
wjmaclean
2014/06/12 17:40:09
Removed ... we're not using it at present anyways.
|
| +} |
| + |
| void RenderViewImpl::didCreateDataSource(WebLocalFrame* frame, |
| WebDataSource* ds) { |
| bool content_initiated = !pending_navigation_params_.get(); |
| @@ -2658,6 +2671,16 @@ void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, |
| #endif |
| } |
| +void RenderViewImpl::OnSetZoomLevelForView(double level) { |
| + webview()->hidePopups(); |
| + webview()->setZoomLevel(level); |
| +} |
| + |
| +void RenderViewImpl::OnSetUsesTemporaryZoomLevel( |
| + bool uses_temporary_zoom_level) { |
| + uses_temporary_zoom_level_ = uses_temporary_zoom_level; |
|
Fady Samuel
2014/06/10 20:05:14
As I mentioned elsewhere, I think we should be mer
|
| +} |
| + |
| void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { |
| webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); |
| } |