Temporarily allow programmatic input assistance for adding Gmail account
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Aug 2015 21:12:47 +0000 (21:12 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Aug 2015 21:12:47 +0000 (21:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147792

Reviewed by Enrica Casucci.
<rdar://problem/22126518>

Temporary fix for keyboard input sliding out and immediately back in upon user interaction
in the Gmail 2-factor authentication page.

Source/WebCore:

* platform/RuntimeApplicationChecksIOS.h:
* platform/RuntimeApplicationChecksIOS.mm:
(WebCore::applicationIsGmailAddAccountOnIOS): Added bundle ID for Gmail settings.

Source/WebKit2:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Early
    return no longer triggers due to lack of user interaction when adding a new Gmail account
    through Settings.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/RuntimeApplicationChecksIOS.h
Source/WebCore/platform/RuntimeApplicationChecksIOS.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

index 067623b825f414d9b8d8e7afd511fc02dbe703d2..ca02143aabbecbb28e601984f9f26ea7916590f6 100644 (file)
@@ -1,3 +1,18 @@
+2015-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Temporarily allow programmatic input assistance for adding Gmail account
+        https://bugs.webkit.org/show_bug.cgi?id=147792
+
+        Reviewed by Enrica Casucci.
+        <rdar://problem/22126518>
+
+        Temporary fix for keyboard input sliding out and immediately back in upon user interaction
+        in the Gmail 2-factor authentication page.
+
+        * platform/RuntimeApplicationChecksIOS.h:
+        * platform/RuntimeApplicationChecksIOS.mm:
+        (WebCore::applicationIsGmailAddAccountOnIOS): Added bundle ID for Gmail settings.
+
 2015-08-07  Andy Estes  <aestes@apple.com>
 
         Crash when following a Google search link to Twitter with Limit Adult Content enabled
index 77a8da930ce537b9783bd3a05da9822aacc8f077..691c8cbbfde77c45607728b0c7f04163861d61e8 100644 (file)
@@ -43,6 +43,7 @@ bool applicationIsMASH();
 WEBCORE_EXPORT bool applicationIsTheEconomistOnIPhone();
 bool applicationIsWebProcess();
 bool applicationIsIBooksOnIOS();
+WEBCORE_EXPORT bool applicationIsGmailAddAccountOnIOS();
 
 } // namespace WebCore
 
index 4629f44505c0b7a6e50adf43690de4149bac18ac..1a541bb260b7d55c1e080d6b42258e9115acf94e 100644 (file)
@@ -122,6 +122,12 @@ bool applicationIsIBooksOnIOS()
     return isIBooksOnIOS;
 }
 
+bool applicationIsGmailAddAccountOnIOS()
+{
+    static const bool isGmailAddAccountOnIOS = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.social.SLGoogleAuth.SLGoogleAuthService"];
+    return isGmailAddAccountOnIOS;
+}
+
 } // namespace WebCore
 
 #endif // PLATFORM(IOS)
index c9d55c350a5bb8bcc0b84cb5de54e0555759ecf7..63c4a0f0c40f6b25a1822410df24660625a4134c 100644 (file)
@@ -1,3 +1,19 @@
+2015-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Temporarily allow programmatic input assistance for adding Gmail account
+        https://bugs.webkit.org/show_bug.cgi?id=147792
+
+        Reviewed by Enrica Casucci.
+        <rdar://problem/22126518>
+
+        Temporary fix for keyboard input sliding out and immediately back in upon user interaction
+        in the Gmail 2-factor authentication page.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Early
+            return no longer triggers due to lack of user interaction when adding a new Gmail account
+            through Settings.
+
 2015-08-07  Brady Eidson  <beidson@apple.com>
 
         Move concrete KeyedDecoder/Encoder implementations to WebCore.
index 62a83c7320d3618416a3bdaa878a2418f2e11e8c..1de5f4ef82198a7f8da9d276bcdac50953508fa3 100644 (file)
@@ -64,6 +64,7 @@
 #import <WebCore/Pasteboard.h>
 #import <WebCore/Path.h>
 #import <WebCore/PathUtilities.h>
+#import <WebCore/RuntimeApplicationChecksIOS.h>
 #import <WebCore/Scrollbar.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextIndicator.h>
@@ -3018,7 +3019,9 @@ static bool isAssistableInputType(InputType type)
 
 - (void)_startAssistingNode:(const AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode userObject:(NSObject <NSSecureCoding> *)userObject
 {
-    if (!userIsInteracting && !_textSelectionAssistant)
+    // FIXME: This is a temporary workaround for <rdar://problem/22126518>. The real fix will involve refactoring
+    // the way we assist programmatically focused nodes.
+    if (!applicationIsGmailAddAccountOnIOS() && !userIsInteracting && !_textSelectionAssistant)
         return;
 
     if (blurPreviousNode)