8130776: Remove EmbeddedFrame.requestFocusToEmbedder() method
authoraivanov
Wed, 22 Jul 2015 17:33:17 +0300
changeset 32112 16954b3f94fd
parent 32111 77f01a77573d
child 32113 7e5c0719e9a9
8130776: Remove EmbeddedFrame.requestFocusToEmbedder() method Reviewed-by: serb, ant
jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java
jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java
jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java
jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java
jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Sat Jul 18 15:13:16 2015 +0300
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Wed Jul 22 17:33:17 2015 +0300
@@ -687,12 +687,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/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Sat Jul 18 15:13:16 2015 +0300
+++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Wed Jul 22 17:33:17 2015 +0300
@@ -357,15 +357,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/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Sat Jul 18 15:13:16 2015 +0300
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Wed Jul 22 17:33:17 2015 +0300
@@ -251,15 +251,6 @@
         }
     }
 
-    public boolean requestFocusToEmbedder() {
-        if (isEmbeddedInIE) {
-            final WEmbeddedFramePeer peer = AWTAccessor.getComponentAccessor()
-                                                       .getPeer(this);
-            return peer.requestFocusToEmbedder();
-        }
-        return false;
-    }
-
     public void registerAccelerator(AWTKeyStroke stroke) {}
     public void unregisterAccelerator(AWTKeyStroke stroke) {}
 
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Sat Jul 18 15:13:16 2015 +0300
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Wed Jul 22 17:33:17 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/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Sat Jul 18 15:13:16 2015 +0300
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Wed Jul 22 17:33:17 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)