OLD | NEW |
---|---|
(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 } | |
OLD | NEW |