Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java

Issue 573653003: [Chrome Shell]Added code to regain focus on selection of any item from options menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected null check mistake Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
index ab0f53324a519fb38e0ba3038ec04df633bd1ebb..5f34230d04079c5708059947b9a3773217c4f948 100644
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
+++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
@@ -13,6 +13,7 @@ import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.Toast;
import org.chromium.base.ApiCompatibilityUtils;
@@ -291,6 +292,12 @@ public class ChromeShellActivity extends Activity implements AppMenuPropertiesDe
@Override
public boolean onOptionsItemSelected(MenuItem item) {
ChromeShellTab activeTab = getActiveTab();
+ if (activeTab != null) {
+ ViewGroup containerView = activeTab.getContentViewCore().getContainerView();
+ if (containerView.isFocusable() && containerView.isFocusableInTouchMode()) {
+ containerView.requestFocus();
+ }
+ }
switch (item.getItemId()) {
case R.id.signin:
if (ChromeSigninController.get(this).isSignedIn()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698