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

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: 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
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..6833a4e95a8c249b83e85be599010d081e0890e5 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
@@ -291,46 +291,45 @@ public class ChromeShellActivity extends Activity implements AppMenuPropertiesDe
@Override
public boolean onOptionsItemSelected(MenuItem item) {
ChromeShellTab activeTab = getActiveTab();
- 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);
}
}

Powered by Google App Engine
This is Rietveld 408576698