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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/PlatformUtil.java

Issue 1310873003: Implement PlatformUtil::OpenExternal() so that mailto: can work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/chrome_jni_registrar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser;
6
7 import android.content.Context;
8 import android.content.Intent;
9 import android.net.Uri;
10
11 import org.chromium.base.ApplicationStatus;
12 import org.chromium.base.annotations.CalledByNative;
13
14 /**
15 * Utility class for providing platform functionalities.
16 */
17 public class PlatformUtil {
18 @CalledByNative
19 private static void launchExternalProtocol(String url) {
20 if (url.startsWith("mailto:")) {
21 Context context = ApplicationStatus.getApplicationContext();
22 Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(url));
23 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Ted C 2015/09/04 17:32:26 should we add: intent.addCategory(Intent.CATEGORY
qinmin 2015/09/04 17:51:38 Done.
24 context.startActivity(intent);
Ted C 2015/09/04 17:32:26 I would catch ActivityNotFoundException just in ca
qinmin 2015/09/04 17:51:38 Done.
25 }
Ted C 2015/09/04 17:32:26 should we be sending a generic view intent in the
qinmin 2015/09/04 17:51:38 Changed the Intent action to ACTION_VIEW and remov
26 }
Ted C 2015/09/04 17:32:26 And looking a bit more at the intent class, it loo
qinmin 2015/09/04 17:51:38 Done.
27 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/chrome_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698