Commit b6e03f48 authored by ankit2.kumar's avatar ankit2.kumar Committed by Commit bot

[Chrome Shell]Added code to regain focus on selection of any item from options menu.

Currently if some option is selected from options menu then in that
case content view does not gain focus in operations(like prev,next ).
Added code to handle this.

BUG=414219

Review URL: https://codereview.chromium.org/573653003

Cr-Commit-Position: refs/heads/master@{#295661}
parent 69889931
......@@ -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()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment