зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1509266 - [2.0] Update onContextMenu delegate implementations. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D12968 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
29411ef725
Коммит
29cc0db15f
|
@ -899,9 +899,9 @@ public abstract class GeckoApp extends GeckoActivity
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onContextMenu(final GeckoSession session, final int screenX,
|
||||
final int screenY, final String uri,
|
||||
int elementType, final String elementSrc) {
|
||||
public void onContextMenu(final GeckoSession session,
|
||||
final int screenX, final int screenY,
|
||||
final GeckoSession.ContentDelegate.ContextElement element) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -695,11 +695,12 @@ public class CustomTabsActivity extends AppCompatActivity
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onContextMenu(GeckoSession session, int screenX, int screenY,
|
||||
final String uri, int elementType,
|
||||
final String elementSrc) {
|
||||
|
||||
final String content = uri != null ? uri : elementSrc != null ? elementSrc : "";
|
||||
public void onContextMenu(final GeckoSession session,
|
||||
int screenX, int screenY,
|
||||
final ContextElement element) {
|
||||
final String content = element.linkUri != null
|
||||
? element.linkUri
|
||||
: element.srcUri != null ? element.srcUri : "";
|
||||
final Uri validUri = WebApps.getValidURL(content);
|
||||
if (validUri == null) {
|
||||
return;
|
||||
|
|
|
@ -352,9 +352,12 @@ public class WebAppActivity extends AppCompatActivity
|
|||
}
|
||||
|
||||
@Override // GeckoSession.ContentDelegate
|
||||
public void onContextMenu(GeckoSession session, int screenX, int screenY,
|
||||
String uri, int elementType, String elementSrc) {
|
||||
final String content = uri != null ? uri : elementSrc != null ? elementSrc : "";
|
||||
public void onContextMenu(final GeckoSession session,
|
||||
int screenX, int screenY,
|
||||
final ContextElement element) {
|
||||
final String content = element.linkUri != null
|
||||
? element.linkUri
|
||||
: element.srcUri != null ? element.srcUri : "";
|
||||
final Uri validUri = WebApps.getValidURL(content);
|
||||
if (validUri == null) {
|
||||
return;
|
||||
|
|
|
@ -94,7 +94,8 @@ public class TestRunnerActivity extends Activity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onContextMenu(GeckoSession session, int screenX, int screenY, String uri, int elementType, String elementSrc) {
|
||||
public void onContextMenu(GeckoSession session, int screenX, int screenY,
|
||||
ContextElement element) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.mozilla.geckoview.AllowOrDeny
|
|||
import org.mozilla.geckoview.GeckoResponse
|
||||
import org.mozilla.geckoview.GeckoResult
|
||||
import org.mozilla.geckoview.GeckoSession
|
||||
import org.mozilla.geckoview.GeckoSession.ContentDelegate.ContextElement
|
||||
import org.mozilla.geckoview.GeckoSession.NavigationDelegate.LoadRequest
|
||||
import org.mozilla.geckoview.MediaElement
|
||||
import org.mozilla.geckoview.WebRequestError
|
||||
|
@ -38,7 +39,9 @@ class Callbacks private constructor() {
|
|||
override fun onFullScreen(session: GeckoSession, fullScreen: Boolean) {
|
||||
}
|
||||
|
||||
override fun onContextMenu(session: GeckoSession, screenX: Int, screenY: Int, uri: String, elementType: Int, elementSrc: String) {
|
||||
override fun onContextMenu(session: GeckoSession,
|
||||
screenX: Int, screenY: Int,
|
||||
element: ContextElement) {
|
||||
}
|
||||
|
||||
override fun onExternalResponse(session: GeckoSession, response: GeckoSession.WebResponseInfo) {
|
||||
|
|
|
@ -476,12 +476,16 @@ public class GeckoViewActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onContextMenu(GeckoSession session, int screenX, int screenY,
|
||||
String uri, int elementType, String elementSrc) {
|
||||
public void onContextMenu(final GeckoSession session,
|
||||
int screenX, int screenY,
|
||||
final ContextElement element) {
|
||||
Log.d(LOGTAG, "onContextMenu screenX=" + screenX +
|
||||
" screenY=" + screenY + " uri=" + uri +
|
||||
" elementType=" + elementType +
|
||||
" elementSrc=" + elementSrc);
|
||||
" screenY=" + screenY +
|
||||
" type=" + element.type +
|
||||
" linkUri=" + element.linkUri +
|
||||
" title=" + element.title +
|
||||
" alt=" + element.altText +
|
||||
" srcUri=" + element.srcUri);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Загрузка…
Ссылка в новой задаче