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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoScreen.java

Issue 1633763003: Introduce MultiWindowUtils#isLegacyMultiWindow() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 10 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.signin; 5 package org.chromium.chrome.browser.signin;
6 6
7 import android.accounts.Account; 7 import android.accounts.Account;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.os.Bundle; 10 import android.os.Bundle;
(...skipping 30 matching lines...) Expand all
41 /** 41 /**
42 * Launches the signin promo if it needs to be displayed. 42 * Launches the signin promo if it needs to be displayed.
43 * @param activity The parent activity. 43 * @param activity The parent activity.
44 * @return Whether the signin promo is shown. 44 * @return Whether the signin promo is shown.
45 */ 45 */
46 public static boolean launchSigninPromoIfNeeded(final Activity activity) { 46 public static boolean launchSigninPromoIfNeeded(final Activity activity) {
47 // The promo is displayed if Chrome is launched directly (i.e., not with the intent to 47 // The promo is displayed if Chrome is launched directly (i.e., not with the intent to
48 // navigate to and view a URL on startup), the instance is part of the f ield trial, 48 // navigate to and view a URL on startup), the instance is part of the f ield trial,
49 // and the promo has been marked to display. 49 // and the promo has been marked to display.
50 ChromePreferenceManager preferenceManager = ChromePreferenceManager.getI nstance(activity); 50 ChromePreferenceManager preferenceManager = ChromePreferenceManager.getI nstance(activity);
51 if (MultiWindowUtils.getInstance().isMultiWindow(activity)) return false ; 51 if (MultiWindowUtils.getInstance().isLegacyMultiWindow(activity)) return false;
52 if (!preferenceManager.getShowSigninPromo()) return false; 52 if (!preferenceManager.getShowSigninPromo()) return false;
53 preferenceManager.setShowSigninPromo(false); 53 preferenceManager.setShowSigninPromo(false);
54 54
55 String lastSyncName = PrefServiceBridge.getInstance().getSyncLastAccount Name(); 55 String lastSyncName = PrefServiceBridge.getInstance().getSyncLastAccount Name();
56 if (SigninManager.getAndroidSigninPromoExperimentGroup() < 0 56 if (SigninManager.getAndroidSigninPromoExperimentGroup() < 0
57 || ChromeSigninController.get(activity).isSignedIn() 57 || ChromeSigninController.get(activity).isSignedIn()
58 || !TextUtils.isEmpty(lastSyncName)) { 58 || !TextUtils.isEmpty(lastSyncName)) {
59 return false; 59 return false;
60 } 60 }
61 61
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 SigninPromoUma.recordAction(SigninPromoUma.SIGNIN_PROMO_ACCEPTED_WITH_AD VANCED); 155 SigninPromoUma.recordAction(SigninPromoUma.SIGNIN_PROMO_ACCEPTED_WITH_AD VANCED);
156 dismiss(); 156 dismiss();
157 } 157 }
158 158
159 @Override 159 @Override
160 public void onFailedToSetForcedAccount(String forcedAccountName) { 160 public void onFailedToSetForcedAccount(String forcedAccountName) {
161 assert false : "No forced accounts in SigninPromoScreen"; 161 assert false : "No forced accounts in SigninPromoScreen";
162 } 162 }
163 } 163 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoScreen.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698