changeset 10996:45e720f86732

8130776: Remove EmbeddedFrame.requestFocusToEmbedder() method Reviewed-by: serb, ant
author aivanov
date Fri, 31 Jul 2015 15:08:24 +0300
parents 4403161a2a7e
children 658bdc9c2f99
files src/share/classes/sun/applet/AppletPanel.java src/share/classes/sun/awt/EmbeddedFrame.java src/windows/classes/sun/awt/windows/WEmbeddedFrame.java src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java src/windows/native/sun/windows/awt_Frame.cpp
diffstat 5 files changed, 1 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/applet/AppletPanel.java	Thu Jul 30 15:27:02 2015 +0300
+++ b/src/share/classes/sun/applet/AppletPanel.java	Fri Jul 31 15:08:24 2015 +0300
@@ -682,12 +682,7 @@
 
         if (toFocus != null) {
             if (parent instanceof EmbeddedFrame) {
-                // JDK-8056915: Try to request focus to the embedder first and
-                // activate the embedded frame through it
-                if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
-                    // Otherwise activate the embedded frame directly
-                    ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
-                }
+                ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
             }
             // EmbeddedFrame might have focus before the applet was added.
             // Thus after its activation the most recent focus owner will be
--- a/src/share/classes/sun/awt/EmbeddedFrame.java	Thu Jul 30 15:27:02 2015 +0300
+++ b/src/share/classes/sun/awt/EmbeddedFrame.java	Fri Jul 31 15:08:24 2015 +0300
@@ -361,15 +361,6 @@
     public void synthesizeWindowActivation(boolean doActivate) {}
 
     /**
-     * Requests the focus to the embedder.
-     *
-     * @return {@code true} if focus request was successful, and {@code false} otherwise.
-     */
-    public boolean requestFocusToEmbedder() {
-        return false;
-    }
-
-    /**
      * Moves this embedded frame to a new location. The top-left corner of
      * the new location is specified by the <code>x</code> and <code>y</code>
      * parameters relative to the native parent component.
--- a/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Thu Jul 30 15:27:02 2015 +0300
+++ b/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Fri Jul 31 15:08:24 2015 +0300
@@ -248,14 +248,6 @@
         }
     }
 
-    @SuppressWarnings("deprecation")
-    public boolean requestFocusToEmbedder() {
-        if (isEmbeddedInIE) {
-            return ((WEmbeddedFramePeer) getPeer()).requestFocusToEmbedder();
-        }
-        return false;
-    }
-
     public void registerAccelerator(AWTKeyStroke stroke) {}
     public void unregisterAccelerator(AWTKeyStroke stroke) {}
 
--- a/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Thu Jul 30 15:27:02 2015 +0300
+++ b/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Fri Jul 31 15:08:24 2015 +0300
@@ -79,10 +79,4 @@
         return !Win32GraphicsEnvironment.isDWMCompositionEnabled();
     }
 
-    /**
-     * Sets the focus to plugin control window, the parent of embedded frame.
-     * Eventually, it will synthesizeWindowActivation to activate the embedded frame,
-     * if plugin control window gets the focus.
-     */
-    public native boolean requestFocusToEmbedder();
 }
--- a/src/windows/native/sun/windows/awt_Frame.cpp	Thu Jul 30 15:27:02 2015 +0300
+++ b/src/windows/native/sun/windows/awt_Frame.cpp	Fri Jul 31 15:08:24 2015 +0300
@@ -1961,29 +1961,6 @@
     CATCH_BAD_ALLOC;
 }
 
-JNIEXPORT jboolean JNICALL
-Java_sun_awt_windows_WEmbeddedFramePeer_requestFocusToEmbedder(JNIEnv *env, jobject self)
-{
-    jboolean result = JNI_FALSE;
-
-    TRY;
-
-    AwtFrame *frame = NULL;
-
-    PDATA pData;
-    JNI_CHECK_PEER_GOTO(self, ret);
-    frame = (AwtFrame *)pData;
-
-    // JDK-8056915: During initial applet activation, set focus to plugin control window
-    HWND hwndParent = ::GetParent(frame->GetHWnd());
-
-    result = SetFocusToPluginControl(hwndParent);
-
-    CATCH_BAD_ALLOC_RET(JNI_FALSE);
-ret:
-    return result;
-}
-
 } /* extern "C" */
 
 static bool SetFocusToPluginControl(HWND hwndPlugin)