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

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

Issue 1314413004: Cast ChromeShell into the fiery pit of Mount Doom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 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/ChromeShellServiceTabLauncher.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellServiceTabLauncher.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellServiceTabLauncher.java
deleted file mode 100644
index 4780a14e11bb073f05e465d39c65594a0c748151..0000000000000000000000000000000000000000
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellServiceTabLauncher.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.shell;
-
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.provider.Browser;
-
-import org.chromium.components.service_tab_launcher.ServiceTabLauncher;
-import org.chromium.ui.WindowOpenDisposition;
-
-/**
- * Service Tab Launcher implementation for ChromeShell. Provides the ability for Chromium to
- * launch tabs from background services, e.g. a Service Worker.
- *
- * This class is used as the Chrome Shell implementation of the ServiceTabLauncher, and is
- * referred to per a meta-data section in the manifest file.
- */
-public class ChromeShellServiceTabLauncher extends ServiceTabLauncher {
- @Override
- public void launchTab(Context context, int requestId, boolean incognito, String url,
- int disposition, String referrerUrl, int referrerPolicy,
- String extraHeaders, byte[] postData) {
- Intent intent = new Intent(context, ChromeShellActivity.class);
- intent.setAction(Intent.ACTION_MAIN);
- intent.addCategory(Intent.CATEGORY_LAUNCHER);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- intent.setData(Uri.parse(url));
-
- switch (disposition) {
- case WindowOpenDisposition.NEW_WINDOW:
- case WindowOpenDisposition.NEW_POPUP:
- case WindowOpenDisposition.NEW_FOREGROUND_TAB:
- case WindowOpenDisposition.NEW_BACKGROUND_TAB:
- // The browser should attempt to create a new tab.
- intent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true);
- break;
- default:
- // The browser should attempt to re-use an existing tab.
- break;
- }
-
- intent.putExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA, requestId);
-
- // TODO(peter): Support |incognito| when ChromeShell supports that.
- // TODO(peter): Support the referrer information, extra headers and post data if
- // ChromeShell gets support for those properties from intent extras.
-
- context.startActivity(intent);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698