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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.shell; 5 package org.chromium.chrome.shell;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.os.Bundle; 9 import android.os.Bundle;
10 import android.text.TextUtils; 10 import android.text.TextUtils;
11 import android.util.Log; 11 import android.util.Log;
12 import android.view.KeyEvent; 12 import android.view.KeyEvent;
13 import android.view.Menu; 13 import android.view.Menu;
14 import android.view.MenuItem; 14 import android.view.MenuItem;
15 import android.view.View; 15 import android.view.View;
16 import android.view.ViewGroup;
16 import android.widget.Toast; 17 import android.widget.Toast;
17 18
18 import org.chromium.base.ApiCompatibilityUtils; 19 import org.chromium.base.ApiCompatibilityUtils;
19 import org.chromium.base.BaseSwitches; 20 import org.chromium.base.BaseSwitches;
20 import org.chromium.base.CommandLine; 21 import org.chromium.base.CommandLine;
21 import org.chromium.base.ContentUriUtils; 22 import org.chromium.base.ContentUriUtils;
22 import org.chromium.base.MemoryPressureListener; 23 import org.chromium.base.MemoryPressureListener;
23 import org.chromium.base.VisibleForTesting; 24 import org.chromium.base.VisibleForTesting;
24 import org.chromium.base.library_loader.ProcessInitException; 25 import org.chromium.base.library_loader.ProcessInitException;
25 import org.chromium.chrome.browser.DevToolsServer; 26 import org.chromium.chrome.browser.DevToolsServer;
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 mAppMenuHandler.showAppMenu(findViewById(R.id.menu_button), true, fa lse); 285 mAppMenuHandler.showAppMenu(findViewById(R.id.menu_button), true, fa lse);
285 return true; 286 return true;
286 } 287 }
287 return super.onKeyDown(keyCode, event); 288 return super.onKeyDown(keyCode, event);
288 } 289 }
289 290
290 @SuppressWarnings("deprecation") 291 @SuppressWarnings("deprecation")
291 @Override 292 @Override
292 public boolean onOptionsItemSelected(MenuItem item) { 293 public boolean onOptionsItemSelected(MenuItem item) {
293 ChromeShellTab activeTab = getActiveTab(); 294 ChromeShellTab activeTab = getActiveTab();
295 if (activeTab != null) {
296 ViewGroup containerView = activeTab.getContentViewCore().getContaine rView();
297 if (containerView.isFocusable() && containerView.isFocusableInTouchM ode()) {
298 containerView.requestFocus();
299 }
300 }
294 switch (item.getItemId()) { 301 switch (item.getItemId()) {
295 case R.id.signin: 302 case R.id.signin:
296 if (ChromeSigninController.get(this).isSignedIn()) { 303 if (ChromeSigninController.get(this).isSignedIn()) {
297 SyncController.openSignOutDialog(getFragmentManager()); 304 SyncController.openSignOutDialog(getFragmentManager());
298 } else if (AccountManagerHelper.get(this).hasGoogleAccounts()) { 305 } else if (AccountManagerHelper.get(this).hasGoogleAccounts()) {
299 SyncController.openSigninDialog(getFragmentManager()); 306 SyncController.openSigninDialog(getFragmentManager());
300 } else { 307 } else {
301 Toast.makeText(this, R.string.signin_no_account, Toast.LENGT H_SHORT).show(); 308 Toast.makeText(this, R.string.signin_no_account, Toast.LENGT H_SHORT).show();
302 } 309 }
303 return true; 310 return true;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 @VisibleForTesting 407 @VisibleForTesting
401 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) { 408 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) {
402 sWindowAndroidFactory = factory; 409 sWindowAndroidFactory = factory;
403 } 410 }
404 411
405 @VisibleForTesting 412 @VisibleForTesting
406 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) { 413 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) {
407 sAppMenuHandlerFactory = factory; 414 sAppMenuHandlerFactory = factory;
408 } 415 }
409 } 416 }
OLDNEW
« 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