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

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

Issue 263453007: Implement "Save image as" for canvas (chromium side). (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « content/renderer/render_view_impl.h ('k') | 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 (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 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) 1087 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand)
1088 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) 1088 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret)
1089 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, 1089 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect,
1090 OnScrollFocusedEditableNodeIntoRect) 1090 OnScrollFocusedEditableNodeIntoRect)
1091 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, 1091 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent,
1092 OnSetEditCommandsForNextKeyEvent) 1092 OnSetEditCommandsForNextKeyEvent)
1093 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1093 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1094 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) 1094 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
1095 IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName) 1095 IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName)
1096 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) 1096 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt)
1097 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt)
1097 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) 1098 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind)
1098 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) 1099 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding)
1099 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) 1100 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
1100 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevel, OnSetZoomLevel) 1101 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevel, OnSetZoomLevel)
1101 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, 1102 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL,
1102 OnSetZoomLevelForLoadingURL) 1103 OnSetZoomLevelForLoadingURL)
1103 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) 1104 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
1104 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, 1105 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault,
1105 OnResetPageEncodingToDefault) 1106 OnResetPageEncodingToDefault)
1106 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) 1107 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent)
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 if (webview()) 1233 if (webview())
1233 webview()->mainFrame()->stopLoading(); 1234 webview()->mainFrame()->stopLoading();
1234 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnStop()); 1235 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnStop());
1235 main_render_frame_->OnStop(); 1236 main_render_frame_->OnStop();
1236 } 1237 }
1237 1238
1238 void RenderViewImpl::OnCopyImageAt(int x, int y) { 1239 void RenderViewImpl::OnCopyImageAt(int x, int y) {
1239 webview()->copyImageAt(WebPoint(x, y)); 1240 webview()->copyImageAt(WebPoint(x, y));
1240 } 1241 }
1241 1242
1243 void RenderViewImpl::OnSaveImageAt(int x, int y) {
1244 webview()->saveImageAt(WebPoint(x, y));
1245 }
1246
1242 void RenderViewImpl::OnUpdateTargetURLAck() { 1247 void RenderViewImpl::OnUpdateTargetURLAck() {
1243 // Check if there is a targeturl waiting to be sent. 1248 // Check if there is a targeturl waiting to be sent.
1244 if (target_url_status_ == TARGET_PENDING) { 1249 if (target_url_status_ == TARGET_PENDING) {
1245 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, 1250 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_,
1246 pending_target_url_)); 1251 pending_target_url_));
1247 } 1252 }
1248 1253
1249 target_url_status_ = TARGET_NONE; 1254 target_url_status_ = TARGET_NONE;
1250 } 1255 }
1251 1256
(...skipping 3112 matching lines...) Expand 10 before | Expand all | Expand 10 after
4364 std::vector<gfx::Size> sizes; 4369 std::vector<gfx::Size> sizes;
4365 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4370 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4366 if (!url.isEmpty()) 4371 if (!url.isEmpty())
4367 urls.push_back( 4372 urls.push_back(
4368 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4373 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4369 } 4374 }
4370 SendUpdateFaviconURL(urls); 4375 SendUpdateFaviconURL(urls);
4371 } 4376 }
4372 4377
4373 } // namespace content 4378 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698