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

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: Nits. Created 4 years, 6 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (addMac) { 75 if (addMac) {
76 // Needed for security reasons. If the MAC is excluded, the URL of the webapp is opened 76 // Needed for security reasons. If the MAC is excluded, the URL of the webapp is opened
77 // in a browser window, instead. 77 // in a browser window, instead.
78 String mac = ShortcutHelper.getEncodedMac(getInstrumentation().getTa rgetContext(), url); 78 String mac = ShortcutHelper.getEncodedMac(getInstrumentation().getTa rgetContext(), url);
79 intent.putExtra(ShortcutHelper.EXTRA_MAC, mac); 79 intent.putExtra(ShortcutHelper.EXTRA_MAC, mac);
80 } 80 }
81 81
82 WebappInfo webappInfo = WebappInfo.create(id, url, icon, title, null, 82 WebappInfo webappInfo = WebappInfo.create(id, url, icon, title, null,
83 WebDisplayMode.Standalone, ScreenOrientationValues.PORTRAIT, Sho rtcutSource.UNKNOWN, 83 WebDisplayMode.Standalone, ScreenOrientationValues.PORTRAIT, Sho rtcutSource.UNKNOWN,
84 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, 84 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING,
85 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false); 85 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false, null);
86 webappInfo.setWebappIntentExtras(intent); 86 webappInfo.setWebappIntentExtras(intent);
87 87
88 return intent; 88 return intent;
89 } 89 }
90 90
91 private void fireWebappIntent(String id, String url, String title, String ic on, 91 private void fireWebappIntent(String id, String url, String title, String ic on,
92 boolean addMac) throws Exception { 92 boolean addMac) throws Exception {
93 Intent intent = createIntent(id, url, title, icon, addMac); 93 Intent intent = createIntent(id, url, title, icon, addMac);
94 94
95 getInstrumentation().getTargetContext().startActivity(intent); 95 getInstrumentation().getTargetContext().startActivity(intent);
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 373
374 WebappActivity webappActivity = (WebappActivity) lastActivity; 374 WebappActivity webappActivity = (WebappActivity) lastActivity;
375 if (webappActivity.getActivityTab() == null) return false; 375 if (webappActivity.getActivityTab() == null) return false;
376 376
377 View rootView = webappActivity.findViewById(android.R.id.content); 377 View rootView = webappActivity.findViewById(android.R.id.content);
378 if (!rootView.hasWindowFocus()) return false; 378 if (!rootView.hasWindowFocus()) return false;
379 379
380 return true; 380 return true;
381 } 381 }
382 } 382 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698