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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java

Issue 1989283002: Upstream: Launch WebApkActivity from WebAPK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
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.app.Activity; 7 import android.app.Activity;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.SharedPreferences; 10 import android.content.SharedPreferences;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 71 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
72 intent.setPackage(getInstrumentation().getTargetContext().getPackageName ()); 72 intent.setPackage(getInstrumentation().getTargetContext().getPackageName ());
73 intent.setAction(WebappLauncherActivity.ACTION_START_WEBAPP); 73 intent.setAction(WebappLauncherActivity.ACTION_START_WEBAPP);
74 if (addMac) { 74 if (addMac) {
75 // Needed for security reasons. If the MAC is excluded, the URL of the webapp is opened 75 // Needed for security reasons. If the MAC is excluded, the URL of the webapp is opened
76 // in a browser window, instead. 76 // in a browser window, instead.
77 String mac = ShortcutHelper.getEncodedMac(getInstrumentation().getTa rgetContext(), url); 77 String mac = ShortcutHelper.getEncodedMac(getInstrumentation().getTa rgetContext(), url);
78 intent.putExtra(ShortcutHelper.EXTRA_MAC, mac); 78 intent.putExtra(ShortcutHelper.EXTRA_MAC, mac);
79 } 79 }
80 80
81 WebappInfo webappInfo = WebappInfo.create(id, url, icon, title, null, 81 WebappInfo webappInfo = WebappInfo.create(id, url, icon, null, title, nu ll,
82 ScreenOrientationValues.PORTRAIT, ShortcutSource.UNKNOWN, 82 ScreenOrientationValues.PORTRAIT, ShortcutSource.UNKNOWN,
83 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, 83 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING,
84 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false); 84 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false, null);
85 webappInfo.setWebappIntentExtras(intent); 85 webappInfo.setWebappIntentExtras(intent);
86 86
87 return intent; 87 return intent;
88 } 88 }
89 89
90 private void fireWebappIntent(String id, String url, String title, String ic on, 90 private void fireWebappIntent(String id, String url, String title, String ic on,
91 boolean addMac) throws Exception { 91 boolean addMac) throws Exception {
92 Intent intent = createIntent(id, url, title, icon, addMac); 92 Intent intent = createIntent(id, url, title, icon, addMac);
93 93
94 getInstrumentation().getTargetContext().startActivity(intent); 94 getInstrumentation().getTargetContext().startActivity(intent);
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 WebappActivity webappActivity = (WebappActivity) lastActivity; 373 WebappActivity webappActivity = (WebappActivity) lastActivity;
374 if (webappActivity.getActivityTab() == null) return false; 374 if (webappActivity.getActivityTab() == null) return false;
375 375
376 View rootView = webappActivity.findViewById(android.R.id.content); 376 View rootView = webappActivity.findViewById(android.R.id.content);
377 if (!rootView.hasWindowFocus()) return false; 377 if (!rootView.hasWindowFocus()) return false;
378 378
379 return true; 379 return true;
380 } 380 }
381 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698