OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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.chrome.browser.webapps; | 5 package org.chromium.chrome.browser.webapps; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.net.Uri; | 9 import android.net.Uri; |
10 import android.os.Bundle; | 10 import android.os.Bundle; |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 @Override | 309 @Override |
310 protected FullScreenTabWebContentsDelegateAndroid createWebContentsDelegate(
) { | 310 protected FullScreenTabWebContentsDelegateAndroid createWebContentsDelegate(
) { |
311 return new FullScreenTabWebContentsDelegateAndroid(); | 311 return new FullScreenTabWebContentsDelegateAndroid(); |
312 } | 312 } |
313 | 313 |
314 private class FullScreenTabWebContentsDelegateAndroid | 314 private class FullScreenTabWebContentsDelegateAndroid |
315 extends TabChromeWebContentsDelegateAndroid { | 315 extends TabChromeWebContentsDelegateAndroid { |
316 @Override | 316 @Override |
317 public void activateContents() { | 317 public void activateContents() { |
318 if (!(mActivity instanceof WebappActivity)) return; | 318 if (!(getActivity() instanceof WebappActivity)) return; |
319 | 319 |
320 WebappInfo webappInfo = ((WebappActivity) mActivity).getWebappInfo()
; | 320 WebappInfo webappInfo = ((WebappActivity) getActivity()).getWebappIn
fo(); |
321 String url = webappInfo.uri().toString(); | 321 String url = webappInfo.uri().toString(); |
322 | 322 |
323 // Create an Intent that will be fired toward the WebappLauncherActi
vity, which in turn | 323 // Create an Intent that will be fired toward the WebappLauncherActi
vity, which in turn |
324 // will fire an Intent to launch the correct WebappActivity. On L+
this could probably | 324 // will fire an Intent to launch the correct WebappActivity. On L+
this could probably |
325 // be changed to call AppTask.moveToFront(), but for backwards compa
tibility we relaunch | 325 // be changed to call AppTask.moveToFront(), but for backwards compa
tibility we relaunch |
326 // it the hard way. | 326 // it the hard way. |
327 Intent intent = new Intent(); | 327 Intent intent = new Intent(); |
328 intent.setAction(WebappLauncherActivity.ACTION_START_WEBAPP); | 328 intent.setAction(WebappLauncherActivity.ACTION_START_WEBAPP); |
329 intent.setPackage(mActivity.getPackageName()); | 329 intent.setPackage(getApplicationContext().getPackageName()); |
330 webappInfo.setWebappIntentExtras(intent); | 330 webappInfo.setWebappIntentExtras(intent); |
331 | 331 |
332 intent.putExtra(ShortcutHelper.EXTRA_MAC, ShortcutHelper.getEncodedM
ac(mActivity, url)); | 332 intent.putExtra(ShortcutHelper.EXTRA_MAC, |
| 333 ShortcutHelper.getEncodedMac(getActivity(), url)); |
333 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 334 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
334 getApplicationContext().startActivity(intent); | 335 getApplicationContext().startActivity(intent); |
335 } | 336 } |
336 } | 337 } |
337 } | 338 } |
OLD | NEW |