OLD | NEW |
---|---|
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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1411 input_handler_->set_handling_input_event(true); | 1411 input_handler_->set_handling_input_event(true); |
1412 webview()->focusedFrame()->selectWordAroundCaret(); | 1412 webview()->focusedFrame()->selectWordAroundCaret(); |
1413 input_handler_->set_handling_input_event(false); | 1413 input_handler_->set_handling_input_event(false); |
1414 } | 1414 } |
1415 | 1415 |
1416 void RenderViewImpl::OnCopyImageAt(int x, int y) { | 1416 void RenderViewImpl::OnCopyImageAt(int x, int y) { |
1417 webview()->copyImageAt(WebPoint(x, y)); | 1417 webview()->copyImageAt(WebPoint(x, y)); |
1418 } | 1418 } |
1419 | 1419 |
1420 void RenderViewImpl::OnSaveImageAt(int x, int y) { | 1420 void RenderViewImpl::OnSaveImageAt(int x, int y) { |
1421 webview()->saveImageAt(WebPoint(x, y)); | 1421 webview()->saveImageAt(WebPoint(x, y)); |
Charlie Reis
2016/03/29 04:41:49
From codesearch, it looks like this is what trigge
| |
1422 } | 1422 } |
1423 | 1423 |
1424 void RenderViewImpl::OnUpdateTargetURLAck() { | 1424 void RenderViewImpl::OnUpdateTargetURLAck() { |
1425 // Check if there is a targeturl waiting to be sent. | 1425 // Check if there is a targeturl waiting to be sent. |
1426 if (target_url_status_ == TARGET_PENDING) | 1426 if (target_url_status_ == TARGET_PENDING) |
1427 Send(new ViewHostMsg_UpdateTargetURL(GetRoutingID(), pending_target_url_)); | 1427 Send(new ViewHostMsg_UpdateTargetURL(GetRoutingID(), pending_target_url_)); |
1428 | 1428 |
1429 target_url_status_ = TARGET_NONE; | 1429 target_url_status_ = TARGET_NONE; |
1430 } | 1430 } |
1431 | 1431 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1683 } | 1683 } |
1684 | 1684 |
1685 void RenderViewImpl::printPage(WebLocalFrame* frame) { | 1685 void RenderViewImpl::printPage(WebLocalFrame* frame) { |
1686 FOR_EACH_OBSERVER(RenderViewObserver, observers_, | 1686 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
1687 PrintPage(frame, input_handler().handling_input_event())); | 1687 PrintPage(frame, input_handler().handling_input_event())); |
1688 } | 1688 } |
1689 | 1689 |
1690 void RenderViewImpl::saveImageFromDataURL(const blink::WebString& data_url) { | 1690 void RenderViewImpl::saveImageFromDataURL(const blink::WebString& data_url) { |
1691 // Note: We should basically send GURL but we use size-limited string instead | 1691 // Note: We should basically send GURL but we use size-limited string instead |
1692 // in order to send a larger data url to save a image for <canvas> or <img>. | 1692 // in order to send a larger data url to save a image for <canvas> or <img>. |
1693 if (data_url.length() < kMaxLengthOfDataURLString) | 1693 if (data_url.length() < kMaxLengthOfDataURLString) { |
1694 Send(new ViewHostMsg_SaveImageFromDataURL( | 1694 Send(new FrameHostMsg_SaveImageFromDataURL( |
1695 GetRoutingID(), GetMainRenderFrame()->GetRoutingID(), data_url.utf8())); | 1695 GetRoutingID(), GetMainRenderFrame()->GetRoutingID(), |
Charlie Reis
2016/03/29 04:41:49
This looks problematic-- we probably shouldn't be
brettw
2016/03/29 05:44:39
It seems to fix the repro steps. I looked through
Charlie Reis
2016/03/29 18:17:13
Ok. CC'ing rdsmith (who added the RFH ID, I think
asanka
2016/03/29 20:56:05
AFAICT the reason why it's not crashing is:
* Non
| |
1696 data_url.utf8())); | |
1697 } | |
1696 } | 1698 } |
1697 | 1699 |
1698 bool RenderViewImpl::enumerateChosenDirectory( | 1700 bool RenderViewImpl::enumerateChosenDirectory( |
1699 const WebString& path, | 1701 const WebString& path, |
1700 WebFileChooserCompletion* chooser_completion) { | 1702 WebFileChooserCompletion* chooser_completion) { |
1701 int id = enumeration_completion_id_++; | 1703 int id = enumeration_completion_id_++; |
1702 enumeration_completions_[id] = chooser_completion; | 1704 enumeration_completions_[id] = chooser_completion; |
1703 return Send(new ViewHostMsg_EnumerateDirectory( | 1705 return Send(new ViewHostMsg_EnumerateDirectory( |
1704 GetRoutingID(), id, blink::WebStringToFilePath(path))); | 1706 GetRoutingID(), id, blink::WebStringToFilePath(path))); |
1705 } | 1707 } |
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3439 if (IsUseZoomForDSFEnabled()) { | 3441 if (IsUseZoomForDSFEnabled()) { |
3440 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3442 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3441 } else { | 3443 } else { |
3442 webview()->setDeviceScaleFactor(device_scale_factor_); | 3444 webview()->setDeviceScaleFactor(device_scale_factor_); |
3443 } | 3445 } |
3444 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3446 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3445 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3447 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3446 } | 3448 } |
3447 | 3449 |
3448 } // namespace content | 3450 } // namespace content |
OLD | NEW |