summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-23 22:03:13 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-23 22:03:13 +0000
commitd76861b26d0d2ed0688745e3365ca0754e683b14 (patch)
tree5b7ef765baeb07383f66acf1d5149cf99f191e98
parentb3f76613e59063577305354117627010696d61e3 (diff)
parent6685f5212500be05037f67ebfb34c1cd4e0d85f9 (diff)
downloadappindexing-studio-2022.1.1-canary.tar.gz
Change-Id: If381bb0b72d46f7b9a01f6c814137190ad3b01bf
-rw-r--r--src/com/google/appindexing/ui/AppIndexingDialog.java20
-rw-r--r--src/com/google/appindexing/ui/CheckErrorDialog.java17
2 files changed, 23 insertions, 14 deletions
diff --git a/src/com/google/appindexing/ui/AppIndexingDialog.java b/src/com/google/appindexing/ui/AppIndexingDialog.java
index 4fb2328..3c4d5e4 100644
--- a/src/com/google/appindexing/ui/AppIndexingDialog.java
+++ b/src/com/google/appindexing/ui/AppIndexingDialog.java
@@ -44,14 +44,21 @@ import com.intellij.ui.ListCellRendererWrapper;
import com.intellij.ui.SortedComboBoxModel;
import com.intellij.ui.TextFieldWithHistory;
import com.intellij.ui.components.JBTextField;
+import java.awt.Font;
+import java.util.List;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.plaf.basic.BasicComboBoxEditor;
import org.jetbrains.android.facet.AndroidFacet;
import org.jetbrains.annotations.NotNull;
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicComboBoxEditor;
-import java.awt.*;
-import java.util.List;
-
/**
* A dialog which setup config and start a Fetch as Google task.
*/
@@ -117,7 +124,8 @@ public class AppIndexingDialog extends DialogWrapper {
myLoginButton.addActionListener(e -> {
try {
myLoginButton.setEnabled(false);
- GoogleLogin.promptToLogIn(null, () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
+ GoogleLogin.getInstance().logIn(null,
+ () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
}
catch (Exception ex) {
getLog().warn("Login fail", ex);
diff --git a/src/com/google/appindexing/ui/CheckErrorDialog.java b/src/com/google/appindexing/ui/CheckErrorDialog.java
index b71d24a..4df0d40 100644
--- a/src/com/google/appindexing/ui/CheckErrorDialog.java
+++ b/src/com/google/appindexing/ui/CheckErrorDialog.java
@@ -32,16 +32,16 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.ui.ListCellRendererWrapper;
import com.intellij.ui.SortedComboBoxModel;
+import java.util.Arrays;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import javax.swing.*;
-
-import java.util.Arrays;
-import java.util.stream.Collector;
-
-import static com.google.appindexing.ui.AppIndexingDialog.isModuleAccepted;
-
/**
* A dialog for users to select a module and login (if necessary) before checking app indexing errors.
*/
@@ -91,7 +91,8 @@ public final class CheckErrorDialog extends DialogWrapper {
myLoginButton.addActionListener(e -> {
try {
myLoginButton.setEnabled(false);
- GoogleLogin.promptToLogIn(null, () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
+ GoogleLogin.getInstance().logIn(null,
+ () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
}
catch (Exception ex) {
getLog().warn("Failed to login with your Google developer account.", ex);