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 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 void RenderViewImpl::OnCopyImageAt(int x, int y) { | 1440 void RenderViewImpl::OnCopyImageAt(int x, int y) { |
1441 webview()->copyImageAt(WebPoint(x, y)); | 1441 webview()->copyImageAt(WebPoint(x, y)); |
1442 } | 1442 } |
1443 | 1443 |
1444 void RenderViewImpl::OnSaveImageAt(int x, int y) { | 1444 void RenderViewImpl::OnSaveImageAt(int x, int y) { |
1445 webview()->saveImageAt(WebPoint(x, y)); | 1445 webview()->saveImageAt(WebPoint(x, y)); |
1446 } | 1446 } |
1447 | 1447 |
1448 void RenderViewImpl::OnUpdateTargetURLAck() { | 1448 void RenderViewImpl::OnUpdateTargetURLAck() { |
1449 // Check if there is a targeturl waiting to be sent. | 1449 // Check if there is a targeturl waiting to be sent. |
1450 if (target_url_status_ == TARGET_PENDING) { | 1450 if (target_url_status_ == TARGET_PENDING) |
1451 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, | 1451 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, pending_target_url_)); |
1452 pending_target_url_)); | |
1453 } | |
1454 | 1452 |
1455 target_url_status_ = TARGET_NONE; | 1453 target_url_status_ = TARGET_NONE; |
1456 } | 1454 } |
1457 | 1455 |
1458 void RenderViewImpl::OnExecuteEditCommand(const std::string& name, | 1456 void RenderViewImpl::OnExecuteEditCommand(const std::string& name, |
1459 const std::string& value) { | 1457 const std::string& value) { |
1460 if (!webview() || !webview()->focusedFrame()) | 1458 if (!webview() || !webview()->focusedFrame()) |
1461 return; | 1459 return; |
1462 | 1460 |
1463 webview()->focusedFrame()->executeCommand( | 1461 webview()->focusedFrame()->executeCommand( |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 // If we have a request in-flight, save the URL to be sent when we | 1882 // If we have a request in-flight, save the URL to be sent when we |
1885 // receive an ACK to the in-flight request. We can happily overwrite | 1883 // receive an ACK to the in-flight request. We can happily overwrite |
1886 // any existing pending sends. | 1884 // any existing pending sends. |
1887 pending_target_url_ = latest_url; | 1885 pending_target_url_ = latest_url; |
1888 target_url_status_ = TARGET_PENDING; | 1886 target_url_status_ = TARGET_PENDING; |
1889 } else { | 1887 } else { |
1890 // URLs larger than |MaxURLChars()| cannot be sent through IPC - | 1888 // URLs larger than |MaxURLChars()| cannot be sent through IPC - |
1891 // see |ParamTraits<GURL>|. | 1889 // see |ParamTraits<GURL>|. |
1892 if (latest_url.possibly_invalid_spec().size() > GetMaxURLChars()) | 1890 if (latest_url.possibly_invalid_spec().size() > GetMaxURLChars()) |
1893 latest_url = GURL(); | 1891 latest_url = GURL(); |
1894 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, latest_url)); | 1892 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, latest_url)); |
1895 target_url_ = latest_url; | 1893 target_url_ = latest_url; |
1896 target_url_status_ = TARGET_INFLIGHT; | 1894 target_url_status_ = TARGET_INFLIGHT; |
1897 } | 1895 } |
1898 } | 1896 } |
1899 | 1897 |
1900 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( | 1898 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( |
1901 const gfx::RectF& rect) const { | 1899 const gfx::RectF& rect) const { |
1902 gfx::RectF window_rect = rect; | 1900 gfx::RectF window_rect = rect; |
1903 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor()); | 1901 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor()); |
1904 return window_rect; | 1902 return window_rect; |
(...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4216 std::vector<gfx::Size> sizes; | 4214 std::vector<gfx::Size> sizes; |
4217 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4215 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4218 if (!url.isEmpty()) | 4216 if (!url.isEmpty()) |
4219 urls.push_back( | 4217 urls.push_back( |
4220 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4218 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4221 } | 4219 } |
4222 SendUpdateFaviconURL(urls); | 4220 SendUpdateFaviconURL(urls); |
4223 } | 4221 } |
4224 | 4222 |
4225 } // namespace content | 4223 } // namespace content |
OLD | NEW |