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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/gsa/GSAState.java

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 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.gsa; 5 package org.chromium.chrome.browser.gsa;
6 6
7 import android.accounts.Account; 7 import android.accounts.Account;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.pm.PackageManager; 10 import android.content.pm.PackageManager;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 */ 80 */
81 public void setGsaAccount(String gsaAccount) { 81 public void setGsaAccount(String gsaAccount) {
82 mGsaAccount = gsaAccount; 82 mGsaAccount = gsaAccount;
83 } 83 }
84 84
85 /** 85 /**
86 * @return Whether GSA and Chrome are logged in with the same account. The s ituation where 86 * @return Whether GSA and Chrome are logged in with the same account. The s ituation where
87 * both are logged out is not considered a match. 87 * both are logged out is not considered a match.
88 */ 88 */
89 public boolean doesGsaAccountMatchChrome() { 89 public boolean doesGsaAccountMatchChrome() {
90 Account chromeUser = ChromeSigninController.get(mContext).getSignedInUse r(); 90 Account chromeUser = ChromeSigninController.get().getSignedInUser();
91 return chromeUser != null && !TextUtils.isEmpty(mGsaAccount) && TextUtil s.equals( 91 return chromeUser != null && !TextUtils.isEmpty(mGsaAccount) && TextUtil s.equals(
92 chromeUser.name, mGsaAccount); 92 chromeUser.name, mGsaAccount);
93 } 93 }
94 94
95 /** 95 /**
96 * @return The current GSA account. May return null if GSA hasn't replied ye t. 96 * @return The current GSA account. May return null if GSA hasn't replied ye t.
97 */ 97 */
98 public String getGsaAccount() { 98 public String getGsaAccount() {
99 return mGsaAccount; 99 return mGsaAccount;
100 } 100 }
(...skipping 25 matching lines...) Expand all
126 * Check whether the given package meets min requirements for using full doc ument mode. 126 * Check whether the given package meets min requirements for using full doc ument mode.
127 * @param packageName The package name we are inquiring about. 127 * @param packageName The package name we are inquiring about.
128 * @param minVersion The minimum version for the package to be. 128 * @param minVersion The minimum version for the package to be.
129 * @return Whether the package exists on the device and its version is highe r than the minimum 129 * @return Whether the package exists on the device and its version is highe r than the minimum
130 * required version. 130 * required version.
131 */ 131 */
132 private boolean isPackageAboveVersion(String packageName, int minVersion) { 132 private boolean isPackageAboveVersion(String packageName, int minVersion) {
133 return PackageUtils.getPackageVersion(mContext, packageName) >= minVersi on; 133 return PackageUtils.getPackageVersion(mContext, packageName) >= minVersi on;
134 } 134 }
135 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698