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

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

Issue 570203002: Make chrome_shell_apk build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-chrome-jamesr
Patch Set: Rebase add chrome_version_java/page_connection_info_javagen Created 6 years, 2 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 | « chrome/android/BUILD.gn ('k') | chrome/browser/ui/BUILD.gn » ('j') | 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 aa0ece9a8c98c02595fec2363ea83997a5f2fdfa..b751a29826dd2e63cb223d369ddcc29c1f4db49c 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
@@ -306,46 +306,45 @@ public class ChromeShellActivity extends Activity implements AppMenuPropertiesDe
containerView.requestFocus();
}
}
- switch (item.getItemId()) {
- case R.id.signin:
- if (ChromeSigninController.get(this).isSignedIn()) {
- SyncController.openSignOutDialog(getFragmentManager());
- } else if (AccountManagerHelper.get(this).hasGoogleAccounts()) {
- SyncController.openSigninDialog(getFragmentManager());
- } else {
- Toast.makeText(this, R.string.signin_no_account, Toast.LENGTH_SHORT).show();
- }
- return true;
- case R.id.print:
- if (activeTab != null) {
- mPrintingController.startPrint(new TabPrinter(activeTab),
- new PrintManagerDelegateImpl(this));
- }
- return true;
- case R.id.distill_page:
- if (activeTab != null) {
- DomDistillerTabUtils.distillCurrentPageAndView(
- activeTab.getContentViewCore().getWebContents());
- }
- return true;
- case R.id.back_menu_id:
- if (activeTab != null && activeTab.canGoBack()) {
- activeTab.goBack();
- }
- return true;
- case R.id.forward_menu_id:
- if (activeTab != null && activeTab.canGoForward()) {
- activeTab.goForward();
- }
- return true;
- case R.id.share_menu_id:
- case R.id.direct_share_menu_id:
- ShareHelper.share(item.getItemId() == R.id.direct_share_menu_id, this,
- activeTab.getTitle(), activeTab.getUrl(), null,
- Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
- return true;
- default:
- return super.onOptionsItemSelected(item);
+ int id = item.getItemId();
+ if (id == R.id.signin) {
+ if (ChromeSigninController.get(this).isSignedIn()) {
+ SyncController.openSignOutDialog(getFragmentManager());
+ } else if (AccountManagerHelper.get(this).hasGoogleAccounts()) {
+ SyncController.openSigninDialog(getFragmentManager());
+ } else {
+ Toast.makeText(this, R.string.signin_no_account, Toast.LENGTH_SHORT).show();
+ }
+ return true;
+ } else if (id == R.id.print) {
+ if (activeTab != null) {
+ mPrintingController.startPrint(new TabPrinter(activeTab),
+ new PrintManagerDelegateImpl(this));
+ }
+ return true;
+ } else if (id == R.id.distill_page) {
+ if (activeTab != null) {
+ DomDistillerTabUtils.distillCurrentPageAndView(
+ activeTab.getContentViewCore().getWebContents());
+ }
+ return true;
+ } else if (id == R.id.back_menu_id) {
+ if (activeTab != null && activeTab.canGoBack()) {
+ activeTab.goBack();
+ }
+ return true;
+ } else if (id == R.id.forward_menu_id) {
+ if (activeTab != null && activeTab.canGoForward()) {
+ activeTab.goForward();
+ }
+ return true;
+ } else if (id == R.id.share_menu_id || id == R.id.direct_share_menu_id) {
+ ShareHelper.share(item.getItemId() == R.id.direct_share_menu_id, this,
+ activeTab.getTitle(), activeTab.getUrl(), null,
+ Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ return true;
+ } else {
+ return super.onOptionsItemSelected(item);
}
}
« no previous file with comments | « chrome/android/BUILD.gn ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698