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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java

Issue 2847523002: Android: Remove GetApplicationContext part 4 (Closed)
Patch Set: Rebase and fix build Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
index 27843622e5d637eec4a7b5ba55bea9901bb8942b..8cccc22fa5fafc497031f8942890ec9b27cee1a6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -662,8 +662,8 @@ public class LocationBarLayout extends FrameLayout
mNavigationButton = (ImageView) findViewById(R.id.navigation_button);
assert mNavigationButton != null : "Missing navigation type view.";
- mNavigationButtonType = DeviceFormFactor.isTablet(context)
- ? NavigationButtonType.PAGE : NavigationButtonType.EMPTY;
+ mNavigationButtonType = DeviceFormFactor.isTablet() ? NavigationButtonType.PAGE
+ : NavigationButtonType.EMPTY;
mSecurityButton = (TintedImageButton) findViewById(R.id.security_button);
mSecurityIconResource = 0;
@@ -902,7 +902,7 @@ public class LocationBarLayout extends FrameLayout
@LocationBarButtonType private int getLocationBarButtonToShow() {
boolean isOffline =
getCurrentTab() != null && OfflinePageUtils.isOfflinePage(getCurrentTab());
- boolean isTablet = DeviceFormFactor.isTablet(getContext());
+ boolean isTablet = DeviceFormFactor.isTablet();
// The navigation icon type is only applicable on tablets. While smaller form factors do
// not have an icon visible to the user when the URL is focused, BUTTON_TYPE_NONE is not
@@ -1255,7 +1255,7 @@ public class LocationBarLayout extends FrameLayout
// Updates the navigation button based on the URL string
private void updateNavigationButton() {
- boolean isTablet = DeviceFormFactor.isTablet(getContext());
+ boolean isTablet = DeviceFormFactor.isTablet();
NavigationButtonType type = NavigationButtonType.EMPTY;
if (isTablet && !mSuggestionItems.isEmpty()) {
// If there are suggestions showing, show the icon for the default suggestion.
@@ -1347,7 +1347,7 @@ public class LocationBarLayout extends FrameLayout
*/
@Override
public void updateSecurityIcon(int securityLevel) {
- boolean isSmallDevice = !DeviceFormFactor.isTablet(getContext());
+ boolean isSmallDevice = !DeviceFormFactor.isTablet();
boolean isOfflinePage =
getCurrentTab() != null && OfflinePageUtils.isOfflinePage(getCurrentTab());
int id = getSecurityIconResource(securityLevel, isSmallDevice, isOfflinePage);
@@ -1403,7 +1403,7 @@ public class LocationBarLayout extends FrameLayout
* @param buttonType The type of navigation button to be shown.
*/
private void setNavigationButtonType(NavigationButtonType buttonType) {
- if (!DeviceFormFactor.isTablet(getContext())) return;
+ if (!DeviceFormFactor.isTablet()) return;
switch (buttonType) {
case PAGE:
Drawable page = ApiCompatibilityUtils.getDrawable(
@@ -2504,6 +2504,6 @@ public class LocationBarLayout extends FrameLayout
@Override
public boolean mustQueryUrlBarLocationForSuggestions() {
- return DeviceFormFactor.isTablet(getContext());
+ return DeviceFormFactor.isTablet();
}
}

Powered by Google App Engine
This is Rietveld 408576698