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

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
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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) 1091 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand)
1092 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) 1092 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret)
1093 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, 1093 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect,
1094 OnScrollFocusedEditableNodeIntoRect) 1094 OnScrollFocusedEditableNodeIntoRect)
1095 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, 1095 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent,
1096 OnSetEditCommandsForNextKeyEvent) 1096 OnSetEditCommandsForNextKeyEvent)
1097 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1097 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1098 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) 1098 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
1099 IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName) 1099 IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName)
1100 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) 1100 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt)
1101 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt)
1101 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) 1102 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind)
1102 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) 1103 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding)
1103 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) 1104 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
1104 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevel, OnSetZoomLevel) 1105 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevel, OnSetZoomLevel)
1105 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, 1106 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL,
1106 OnSetZoomLevelForLoadingURL) 1107 OnSetZoomLevelForLoadingURL)
1107 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) 1108 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
1108 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, 1109 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault,
1109 OnResetPageEncodingToDefault) 1110 OnResetPageEncodingToDefault)
1110 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) 1111 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent)
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 if (webview()) 1237 if (webview())
1237 webview()->mainFrame()->stopLoading(); 1238 webview()->mainFrame()->stopLoading();
1238 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnStop()); 1239 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnStop());
1239 main_render_frame_->OnStop(); 1240 main_render_frame_->OnStop();
1240 } 1241 }
1241 1242
1242 void RenderViewImpl::OnCopyImageAt(int x, int y) { 1243 void RenderViewImpl::OnCopyImageAt(int x, int y) {
1243 webview()->copyImageAt(WebPoint(x, y)); 1244 webview()->copyImageAt(WebPoint(x, y));
1244 } 1245 }
1245 1246
1247 void RenderViewImpl::OnSaveImageAt(int x, int y) {
1248 webview()->saveImageAt(WebPoint(x, y));
1249 }
1250
1246 void RenderViewImpl::OnUpdateTargetURLAck() { 1251 void RenderViewImpl::OnUpdateTargetURLAck() {
1247 // Check if there is a targeturl waiting to be sent. 1252 // Check if there is a targeturl waiting to be sent.
1248 if (target_url_status_ == TARGET_PENDING) { 1253 if (target_url_status_ == TARGET_PENDING) {
1249 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, 1254 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_,
1250 pending_target_url_)); 1255 pending_target_url_));
1251 } 1256 }
1252 1257
1253 target_url_status_ = TARGET_NONE; 1258 target_url_status_ = TARGET_NONE;
1254 } 1259 }
1255 1260
(...skipping 3178 matching lines...) Expand 10 before | Expand all | Expand 10 after
4434 std::vector<gfx::Size> sizes; 4439 std::vector<gfx::Size> sizes;
4435 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4440 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4436 if (!url.isEmpty()) 4441 if (!url.isEmpty())
4437 urls.push_back( 4442 urls.push_back(
4438 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4443 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4439 } 4444 }
4440 SendUpdateFaviconURL(urls); 4445 SendUpdateFaviconURL(urls);
4441 } 4446 }
4442 4447
4443 } // namespace content 4448 } // namespace content
OLDNEW
« content/public/browser/render_view_host.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698