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

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: nit 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.ActivityNotFoundException;
8 import android.content.Context;
9 import android.content.Intent;
10 import android.net.Uri;
11
12 import org.chromium.base.ApplicationStatus;
13 import org.chromium.base.Log;
14 import org.chromium.base.annotations.CalledByNative;
15
16 /**
17 * Utility class for providing platform functionalities.
18 */
19 public class PlatformUtil {
20 private static final String TAG = "cr.PlatformUtil";
21
22 @CalledByNative
23 private static void launchExternalProtocol(String url) {
24 Context context = ApplicationStatus.getApplicationContext();
25 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
26 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
27 intent.addCategory(Intent.CATEGORY_BROWSABLE);
28 try {
29 context.startActivity(intent);
30 } catch (ActivityNotFoundException e) {
31 Log.e(TAG, "cannot find activity to launch " + url, e);
32 }
33 }
34 }
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