Commit 68272510 authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

[iOS] Rename |requestID| to |requestId|.

This CL has no functional change.

Bug: 228355
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I12f9222642ea1679ff714651f256067b03d88d1e
Reviewed-on: https://chromium-review.googlesource.com/980735
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546011}
parent 60c784b7
...@@ -16,7 +16,7 @@ namespace web { ...@@ -16,7 +16,7 @@ namespace web {
// Represents a unique string request ID that is passed through directly from a // Represents a unique string request ID that is passed through directly from a
// call to findElementAtPoint to the response dictionary. The request ID should // call to findElementAtPoint to the response dictionary. The request ID should
// be used to correlate a response with a previous call to findElementAtPoint. // be used to correlate a response with a previous call to findElementAtPoint.
extern NSString* const kContextMenuElementRequestID; extern NSString* const kContextMenuElementRequestId;
// Optional key. Represents element's href attribute if present or parent's href // Optional key. Represents element's href attribute if present or parent's href
// if element is an image. // if element is an image.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace web { namespace web {
NSString* const kContextMenuElementRequestID = @"requestID"; NSString* const kContextMenuElementRequestId = @"requestId";
NSString* const kContextMenuElementHyperlink = @"href"; NSString* const kContextMenuElementHyperlink = @"href";
NSString* const kContextMenuElementSource = @"src"; NSString* const kContextMenuElementSource = @"src";
NSString* const kContextMenuElementTitle = @"title"; NSString* const kContextMenuElementTitle = @"title";
......
...@@ -488,7 +488,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindImageElementAtPoint) { ...@@ -488,7 +488,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindImageElementAtPoint) {
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : @"file:///bogus", kContextMenuElementSource : @"file:///bogus",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
}; };
...@@ -506,7 +506,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindImageElementWithTitleAtPoint) { ...@@ -506,7 +506,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindImageElementWithTitleAtPoint) {
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : @"file:///bogus", kContextMenuElementSource : @"file:///bogus",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementTitle : @"Hello world!", kContextMenuElementTitle : @"Hello world!",
...@@ -526,7 +526,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -526,7 +526,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(0, 0); id result = FindElementAtPoint(0, 0);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
}; };
EXPECT_NSEQ(expected_value, result); EXPECT_NSEQ(expected_value, result);
} }
...@@ -542,7 +542,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -542,7 +542,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(GetWebViewContentSize().width / 2, 50); id result = FindElementAtPoint(GetWebViewContentSize().width / 2, 50);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
}; };
EXPECT_NSEQ(expected_value, result); EXPECT_NSEQ(expected_value, result);
} }
...@@ -562,7 +562,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindLinkImageAtPointForFileUrl) { ...@@ -562,7 +562,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindLinkImageAtPointForFileUrl) {
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : @"file:///bogus", kContextMenuElementSource : @"file:///bogus",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : @"file:///linky", kContextMenuElementHyperlink : @"file:///linky",
...@@ -584,7 +584,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -584,7 +584,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(0, 0); id result = FindElementAtPoint(0, 0);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
}; };
EXPECT_NSEQ(expected_value, result); EXPECT_NSEQ(expected_value, result);
} }
...@@ -603,7 +603,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -603,7 +603,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(GetWebViewContentSize().width / 2, 50); id result = FindElementAtPoint(GetWebViewContentSize().width / 2, 50);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
}; };
EXPECT_NSEQ(expected_value, result); EXPECT_NSEQ(expected_value, result);
} }
...@@ -629,7 +629,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -629,7 +629,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl], kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl],
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : kLinkDest, kContextMenuElementHyperlink : kLinkDest,
...@@ -649,7 +649,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindImageLinkedToJavaScript) { ...@@ -649,7 +649,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, FindImageLinkedToJavaScript) {
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl], kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl],
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : @"javascript:console.log(", kContextMenuElementHyperlink : @"javascript:console.log(",
...@@ -668,7 +668,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -668,7 +668,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl], kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl],
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
}; };
...@@ -688,7 +688,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -688,7 +688,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl], kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl],
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
}; };
...@@ -708,7 +708,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -708,7 +708,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(20, 20); id result = FindElementAtPoint(20, 20);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl], kContextMenuElementSource : [NSString stringWithFormat:@"%sfoo", kTestUrl],
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
}; };
...@@ -730,7 +730,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfImageWithCalloutNone) { ...@@ -730,7 +730,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfImageWithCalloutNone) {
id result = FindElementAtPoint(5, 5); id result = FindElementAtPoint(5, 5);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementInnerText : @"", kContextMenuElementInnerText : @"",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : kLinkDest, kContextMenuElementHyperlink : kLinkDest,
...@@ -758,7 +758,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, TextAreaStopsProximity) { ...@@ -758,7 +758,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, TextAreaStopsProximity) {
id result = FindElementAtPoint(10, 10); id result = FindElementAtPoint(10, 10);
NSDictionary* expected_value = @{ NSDictionary* expected_value = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
}; };
EXPECT_NSEQ(expected_value, result); EXPECT_NSEQ(expected_value, result);
} }
...@@ -809,7 +809,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, MAYBE_LinkOfTextFromTallPage) { ...@@ -809,7 +809,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, MAYBE_LinkOfTextFromTallPage) {
// Link is at bottom of the page content. // Link is at bottom of the page content.
id result = FindElementAtPoint(1, content_height - 5.0); id result = FindElementAtPoint(1, content_height - 5.0);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementInnerText : @"link", kContextMenuElementInnerText : @"link",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : @"http://destination/", kContextMenuElementHyperlink : @"http://destination/",
...@@ -829,7 +829,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithoutCalloutProperty) { ...@@ -829,7 +829,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithoutCalloutProperty) {
id result = FindElementAtPoint(1, 1); id result = FindElementAtPoint(1, 1);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementInnerText : @"link", kContextMenuElementInnerText : @"link",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : kLinkDest, kContextMenuElementHyperlink : kLinkDest,
...@@ -860,7 +860,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, ...@@ -860,7 +860,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest,
id result = FindElementAtPoint(1, 1); id result = FindElementAtPoint(1, 1);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementInnerText : @"link", kContextMenuElementInnerText : @"link",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : kLinkDest, kContextMenuElementHyperlink : kLinkDest,
...@@ -879,7 +879,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithCalloutNone) { ...@@ -879,7 +879,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithCalloutNone) {
ASSERT_TRUE(web::LoadHtml(web_view_, kLinkHtml, GetTestURL())); ASSERT_TRUE(web::LoadHtml(web_view_, kLinkHtml, GetTestURL()));
id result = FindElementAtPoint(1, 1); id result = FindElementAtPoint(1, 1);
EXPECT_NSEQ(@{kContextMenuElementRequestID : kRequestId}, result); EXPECT_NSEQ(@{kContextMenuElementRequestId : kRequestId}, result);
} }
// Tests that -webkit-touch-callout property can be inherited from ancester // Tests that -webkit-touch-callout property can be inherited from ancester
...@@ -894,7 +894,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithCalloutFromAncester) { ...@@ -894,7 +894,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithCalloutFromAncester) {
ASSERT_TRUE(web::LoadHtml(web_view_, kLinkHtml, GetTestURL())); ASSERT_TRUE(web::LoadHtml(web_view_, kLinkHtml, GetTestURL()));
id result = FindElementAtPoint(1, 1); id result = FindElementAtPoint(1, 1);
EXPECT_NSEQ(@{kContextMenuElementRequestID : kRequestId}, result); EXPECT_NSEQ(@{kContextMenuElementRequestId : kRequestId}, result);
} }
// Tests that setting -webkit-touch-callout property can override the value // Tests that setting -webkit-touch-callout property can override the value
...@@ -912,7 +912,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithCalloutOverride) { ...@@ -912,7 +912,7 @@ TEST_F(ContextMenuJsFindElementAtPointTest, LinkOfTextWithCalloutOverride) {
id result = FindElementAtPoint(1, 1); id result = FindElementAtPoint(1, 1);
NSDictionary* expected_result = @{ NSDictionary* expected_result = @{
kContextMenuElementRequestID : kRequestId, kContextMenuElementRequestId : kRequestId,
kContextMenuElementInnerText : @"link", kContextMenuElementInnerText : @"link",
kContextMenuElementReferrerPolicy : @"default", kContextMenuElementReferrerPolicy : @"default",
kContextMenuElementHyperlink : kLinkDest, kContextMenuElementHyperlink : kLinkDest,
......
...@@ -132,14 +132,14 @@ var getResponseForImageElement = function(element) { ...@@ -132,14 +132,14 @@ var getResponseForImageElement = function(element) {
* back to the application by posting a 'FindElementResultHandler' message. * back to the application by posting a 'FindElementResultHandler' message.
* The object will be of the same form as returned by * The object will be of the same form as returned by
* {@code getResponseForLinkElement} or {@code getResponseForImageElement}. * {@code getResponseForLinkElement} or {@code getResponseForImageElement}.
* @param {string} requestID An identifier which will be returned in the result * @param {string} requestId An identifier which will be returned in the result
* dictionary of this request. * dictionary of this request.
* @param {number} x Horizontal center of the selected point in page * @param {number} x Horizontal center of the selected point in page
* coordinates. * coordinates.
* @param {number} y Vertical center of the selected point in page * @param {number} y Vertical center of the selected point in page
* coordinates. * coordinates.
*/ */
__gCrWeb['findElementAtPointInPageCoordinates'] = function(requestID, x, y) { __gCrWeb['findElementAtPointInPageCoordinates'] = function(requestId, x, y) {
var hitCoordinates = spiralCoordinates_(x, y); var hitCoordinates = spiralCoordinates_(x, y);
for (var index = 0; index < hitCoordinates.length; index++) { for (var index = 0; index < hitCoordinates.length; index++) {
var coordinates = hitCoordinates[index]; var coordinates = hitCoordinates[index];
...@@ -152,7 +152,7 @@ __gCrWeb['findElementAtPointInPageCoordinates'] = function(requestID, x, y) { ...@@ -152,7 +152,7 @@ __gCrWeb['findElementAtPointInPageCoordinates'] = function(requestID, x, y) {
element.tagName.toLowerCase() === 'frame')) { element.tagName.toLowerCase() === 'frame')) {
var payload = { var payload = {
type: 'org.chromium.contextMenuMessage', type: 'org.chromium.contextMenuMessage',
requestID: requestID, requestId: requestId,
x: x - element.offsetLeft, x: x - element.offsetLeft,
y: y - element.offsetTop y: y - element.offsetTop
}; };
...@@ -177,19 +177,19 @@ __gCrWeb['findElementAtPointInPageCoordinates'] = function(requestID, x, y) { ...@@ -177,19 +177,19 @@ __gCrWeb['findElementAtPointInPageCoordinates'] = function(requestID, x, y) {
tagName === 'select' || tagName === 'option') { tagName === 'select' || tagName === 'option') {
// If the element is a known input element, stop the spiral search and // If the element is a known input element, stop the spiral search and
// return empty results. // return empty results.
sendFindElementAtPointResponse(requestID, /*response=*/{}); sendFindElementAtPointResponse(requestId, /*response=*/{});
return; return;
} }
if (getComputedWebkitTouchCallout_(element) !== 'none') { if (getComputedWebkitTouchCallout_(element) !== 'none') {
if (tagName === 'a' && element.href) { if (tagName === 'a' && element.href) {
sendFindElementAtPointResponse(requestID, sendFindElementAtPointResponse(requestId,
getResponseForLinkElement(element)); getResponseForLinkElement(element));
return; return;
} }
if (tagName === 'img' && element.src) { if (tagName === 'img' && element.src) {
sendFindElementAtPointResponse(requestID, sendFindElementAtPointResponse(requestId,
getResponseForImageElement(element)); getResponseForImageElement(element));
return; return;
} }
...@@ -197,18 +197,18 @@ __gCrWeb['findElementAtPointInPageCoordinates'] = function(requestID, x, y) { ...@@ -197,18 +197,18 @@ __gCrWeb['findElementAtPointInPageCoordinates'] = function(requestID, x, y) {
element = element.parentNode; element = element.parentNode;
} }
} }
sendFindElementAtPointResponse(requestID, /*response=*/{}); sendFindElementAtPointResponse(requestId, /*response=*/{});
}; };
/** /**
* Inserts |requestID| into |response| and sends the result as the payload of a * Inserts |requestId| into |response| and sends the result as the payload of a
* 'FindElementResultHandler' message back to the native application. * 'FindElementResultHandler' message back to the native application.
* @param {string} requestID An identifier which will be returned in the result * @param {string} requestId An identifier which will be returned in the result
* dictionary of this request. * dictionary of this request.
* @param {!Object} response The 'FindElementResultHandler' message payload. * @param {!Object} response The 'FindElementResultHandler' message payload.
*/ */
var sendFindElementAtPointResponse = function(requestID, response) { var sendFindElementAtPointResponse = function(requestId, response) {
response.requestID = requestID; response.requestId = requestId;
__gCrWeb.common.sendWebKitMessage('FindElementResultHandler', response); __gCrWeb.common.sendWebKitMessage('FindElementResultHandler', response);
}; };
...@@ -385,7 +385,7 @@ window.addEventListener('message', function(message) { ...@@ -385,7 +385,7 @@ window.addEventListener('message', function(message) {
var payload = message.data; var payload = message.data;
if (payload.hasOwnProperty('type') && if (payload.hasOwnProperty('type') &&
payload.type == 'org.chromium.contextMenuMessage') { payload.type == 'org.chromium.contextMenuMessage') {
__gCrWeb.findElementAtPointInPageCoordinates(payload.requestID, __gCrWeb.findElementAtPointInPageCoordinates(payload.requestId,
payload.x, payload.x,
payload.y); payload.y);
} }
......
...@@ -19,7 +19,7 @@ goog.provide('__crWeb.mainFrameContextMenu'); ...@@ -19,7 +19,7 @@ goog.provide('__crWeb.mainFrameContextMenu');
* the application by posting a 'FindElementResultHandler' message. * the application by posting a 'FindElementResultHandler' message.
* The object returned in the message is of the same form as * The object returned in the message is of the same form as
* {@code getElementFromPointInPageCoordinates} result. * {@code getElementFromPointInPageCoordinates} result.
* @param {string} requestID An identifier which be returned in the result * @param {string} requestId An identifier which be returned in the result
* dictionary of this request. * dictionary of this request.
* @param {number} x Horizontal center of the selected point in web view * @param {number} x Horizontal center of the selected point in web view
* coordinates. * coordinates.
...@@ -29,9 +29,9 @@ goog.provide('__crWeb.mainFrameContextMenu'); ...@@ -29,9 +29,9 @@ goog.provide('__crWeb.mainFrameContextMenu');
* @param {number} webViewHeight the height of web view. * @param {number} webViewHeight the height of web view.
*/ */
__gCrWeb['findElementAtPoint'] = __gCrWeb['findElementAtPoint'] =
function(requestID, x, y, webViewWidth, webViewHeight) { function(requestId, x, y, webViewWidth, webViewHeight) {
var scale = getPageWidth() / webViewWidth; var scale = getPageWidth() / webViewWidth;
__gCrWeb.findElementAtPointInPageCoordinates(requestID, __gCrWeb.findElementAtPointInPageCoordinates(requestId,
x * scale, x * scale,
y * scale); y * scale);
}; };
......
...@@ -120,7 +120,7 @@ NSString* const kFindElementResultHandlerName = @"FindElementResultHandler"; ...@@ -120,7 +120,7 @@ NSString* const kFindElementResultHandlerName = @"FindElementResultHandler";
// The location of the last reconized long press in the |webView|. // The location of the last reconized long press in the |webView|.
CGPoint _locationForLastTouch; CGPoint _locationForLastTouch;
// Details for currently in progress element fetches. The objects are // Details for currently in progress element fetches. The objects are
// instances of HTMLElementFetchRequest and are keyed by a unique requestID // instances of HTMLElementFetchRequest and are keyed by a unique requestId
// string. // string.
NSMutableDictionary* _pendingElementFetchRequests; NSMutableDictionary* _pendingElementFetchRequests;
} }
...@@ -328,7 +328,7 @@ NSString* const kFindElementResultHandlerName = @"FindElementResultHandler"; ...@@ -328,7 +328,7 @@ NSString* const kFindElementResultHandlerName = @"FindElementResultHandler";
- (void)didReceiveScriptMessage:(WKScriptMessage*)message { - (void)didReceiveScriptMessage:(WKScriptMessage*)message {
NSDictionary* response = message.body; NSDictionary* response = message.body;
NSString* requestID = response[web::kContextMenuElementRequestID]; NSString* requestID = response[web::kContextMenuElementRequestId];
HTMLElementFetchRequest* fetchRequest = HTMLElementFetchRequest* fetchRequest =
_pendingElementFetchRequests[requestID]; _pendingElementFetchRequests[requestID];
// Do not process the message if a fetch request with a matching |requestID| // Do not process the message if a fetch request with a matching |requestID|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment