OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.content.ActivityNotFoundException; | 7 import android.content.ActivityNotFoundException; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.graphics.Rect; | 10 import android.graphics.Rect; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 /** | 126 /** |
127 * Called when the contextual ActionBar is hidden. | 127 * Called when the contextual ActionBar is hidden. |
128 */ | 128 */ |
129 public void onContextualActionBarHidden() { | 129 public void onContextualActionBarHidden() { |
130 } | 130 } |
131 | 131 |
132 /** | 132 /** |
133 * Called when a new content intent is requested to be started. | 133 * Called when a new content intent is requested to be started. |
134 */ | 134 */ |
135 public void onStartContentIntent(Context context, String contentUrl) { | 135 public void onStartContentIntent(Context context, String intentUrl) { |
136 Intent intent; | 136 Intent intent; |
137 // Perform generic parsing of the URI to turn it into an Intent. | 137 // Perform generic parsing of the URI to turn it into an Intent. |
138 try { | 138 try { |
139 intent = Intent.parseUri(contentUrl, Intent.URI_INTENT_SCHEME); | 139 intent = Intent.parseUri(intentUrl, Intent.URI_INTENT_SCHEME); |
140 } catch (URISyntaxException ex) { | 140 } catch (URISyntaxException ex) { |
141 Log.w(TAG, "Bad URI " + contentUrl + ": " + ex.getMessage()); | 141 Log.w(TAG, "Bad URI " + intentUrl + ": " + ex.getMessage()); |
142 return; | 142 return; |
143 } | 143 } |
144 | 144 |
145 try { | 145 try { |
146 context.startActivity(intent); | 146 context.startActivity(intent); |
147 } catch (ActivityNotFoundException ex) { | 147 } catch (ActivityNotFoundException ex) { |
148 Log.w(TAG, "No application can handle " + contentUrl); | 148 Log.w(TAG, "No application can handle " + intentUrl); |
149 } | 149 } |
150 } | 150 } |
151 } | 151 } |
OLD | NEW |