Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Rebase updated
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Nov 25, 2019
1 parent e1361dc commit 2ff5af0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ public void onFxALogin(@NonNull View view) {
WidgetManagerDelegate widgetManager = ((VRBrowserActivity) getContext());
widgetManager.openNewTabForeground(url);
widgetManager.getFocusedWindow().getSession().setUaMode(GeckoSessionSettings.USER_AGENT_MODE_MOBILE);

mBookmarksViewListeners.forEach((listener) -> listener.onFxALogin(view));
}

}, mUIThreadExecutor).exceptionally(throwable -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ public void onFxALogin(@NonNull View view) {
WidgetManagerDelegate widgetManager = ((VRBrowserActivity) getContext());
widgetManager.openNewTabForeground(url);
widgetManager.getFocusedWindow().getSession().setUaMode(GeckoSessionSettings.USER_AGENT_MODE_MOBILE);

mHistoryViewListeners.forEach((listener) -> listener.onFxALogin(view));
}

}, mUIThreadExecutor).exceptionally(throwable -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,11 @@ public void onHideContextMenu(@NonNull View view) {
public void onItemClicked(@NonNull View view, Bookmark item) {
hideBookmarks();
}

@Override
public void onFxALogin(@NonNull View view) {
hideBookmarks();
}
};

private HistoryCallback mHistoryListener = new HistoryCallback() {
Expand Down Expand Up @@ -1462,6 +1467,11 @@ public void onHideContextMenu(@NonNull View view) {
public void onItemClicked(@NonNull View view, VisitInfo item) {
hideHistory();
}

@Override
public void onFxALogin(@NonNull View view) {
hideHistory();
}
};

private void hideContextMenus() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ private void signIn(View view) {
mAccounts.logoutAsync();

} else {
hide(REMOVE_WIDGET);

CompletableFuture<String> result = mAccounts.authUrlAsync();
if (result != null) {
result.thenAcceptAsync((url) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,12 @@ private void manageAccount() {
switch(mAccounts.getAccountStatus()) {
case SIGNED_OUT:
case NEEDS_RECONNECT:
hide(REMOVE_WIDGET);
if (mAccounts.getAccountStatus() == Accounts.AccountStatus.SIGNED_IN) {
mAccounts.logoutAsync();

} else {
hide(REMOVE_WIDGET);

CompletableFuture<String> result = mAccounts.authUrlAsync();
if (result != null) {
result.thenAcceptAsync((url) -> {
Expand Down

0 comments on commit 2ff5af0

Please sign in to comment.