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

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

Issue 723223004: Using FLAG_ACTIVITY_NEW_TASK flag for sharing in Chrome Shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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;
(...skipping 16 matching lines...) Expand all
27 import org.chromium.chrome.browser.FileProviderHelper; 27 import org.chromium.chrome.browser.FileProviderHelper;
28 import org.chromium.chrome.browser.appmenu.AppMenuHandler; 28 import org.chromium.chrome.browser.appmenu.AppMenuHandler;
29 import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate; 29 import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate;
30 import org.chromium.chrome.browser.dom_distiller.DomDistillerTabUtils; 30 import org.chromium.chrome.browser.dom_distiller.DomDistillerTabUtils;
31 import org.chromium.chrome.browser.nfc.BeamController; 31 import org.chromium.chrome.browser.nfc.BeamController;
32 import org.chromium.chrome.browser.nfc.BeamProvider; 32 import org.chromium.chrome.browser.nfc.BeamProvider;
33 import org.chromium.chrome.browser.printing.PrintingControllerFactory; 33 import org.chromium.chrome.browser.printing.PrintingControllerFactory;
34 import org.chromium.chrome.browser.printing.TabPrinter; 34 import org.chromium.chrome.browser.printing.TabPrinter;
35 import org.chromium.chrome.browser.share.ShareHelper; 35 import org.chromium.chrome.browser.share.ShareHelper;
36 import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; 36 import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
37 import org.chromium.chrome.browser.util.ChromeApiCompatibilityUtils;
37 import org.chromium.chrome.shell.sync.SyncController; 38 import org.chromium.chrome.shell.sync.SyncController;
38 import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; 39 import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils;
39 import org.chromium.content.app.ContentApplication; 40 import org.chromium.content.app.ContentApplication;
40 import org.chromium.content.browser.ActivityContentVideoViewClient; 41 import org.chromium.content.browser.ActivityContentVideoViewClient;
41 import org.chromium.content.browser.BrowserStartupController; 42 import org.chromium.content.browser.BrowserStartupController;
42 import org.chromium.content.browser.ContentViewCore; 43 import org.chromium.content.browser.ContentViewCore;
43 import org.chromium.content.browser.DeviceUtils; 44 import org.chromium.content.browser.DeviceUtils;
44 import org.chromium.printing.PrintManagerDelegateImpl; 45 import org.chromium.printing.PrintManagerDelegateImpl;
45 import org.chromium.printing.PrintingController; 46 import org.chromium.printing.PrintingController;
46 import org.chromium.sync.signin.AccountManagerHelper; 47 import org.chromium.sync.signin.AccountManagerHelper;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 if (activeTab != null && activeTab.canGoForward()) { 349 if (activeTab != null && activeTab.canGoForward()) {
349 activeTab.goForward(); 350 activeTab.goForward();
350 } 351 }
351 return true; 352 return true;
352 } else if (id == R.id.new_tab_menu_id) { 353 } else if (id == R.id.new_tab_menu_id) {
353 mTabManager.createNewTab(); 354 mTabManager.createNewTab();
354 return true; 355 return true;
355 } else if (id == R.id.share_menu_id || id == R.id.direct_share_menu_id) { 356 } else if (id == R.id.share_menu_id || id == R.id.direct_share_menu_id) {
356 ShareHelper.share(item.getItemId() == R.id.direct_share_menu_id, thi s, 357 ShareHelper.share(item.getItemId() == R.id.direct_share_menu_id, thi s,
357 activeTab.getTitle(), activeTab.getUrl(), null, 358 activeTab.getTitle(), activeTab.getUrl(), null,
358 Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); 359 ChromeApiCompatibilityUtils.getActivityNewDocumentFlag());
359 return true; 360 return true;
360 } else { 361 } else {
361 return super.onOptionsItemSelected(item); 362 return super.onOptionsItemSelected(item);
362 } 363 }
363 } 364 }
364 365
365 private void waitForDebuggerIfNeeded() { 366 private void waitForDebuggerIfNeeded() {
366 if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUG GER)) { 367 if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUG GER)) {
367 Log.e(TAG, "Waiting for Java debugger to connect..."); 368 Log.e(TAG, "Waiting for Java debugger to connect...");
368 android.os.Debug.waitForDebugger(); 369 android.os.Debug.waitForDebugger();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 @VisibleForTesting 434 @VisibleForTesting
434 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) { 435 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) {
435 sWindowAndroidFactory = factory; 436 sWindowAndroidFactory = factory;
436 } 437 }
437 438
438 @VisibleForTesting 439 @VisibleForTesting
439 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) { 440 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) {
440 sAppMenuHandlerFactory = factory; 441 sAppMenuHandlerFactory = factory;
441 } 442 }
442 } 443 }
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