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

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

Issue 2821223004: [Home] Show the app menu icons as a footer (Closed)
Patch Set: Changes from tedchoc@ review 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; 5 package org.chromium.chrome.browser;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.app.Activity; 9 import android.app.Activity;
10 import android.app.ActivityManager; 10 import android.app.ActivityManager;
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 1258
1259 if (startIncognito) mTabModelSelectorImpl.selectModel(true); 1259 if (startIncognito) mTabModelSelectorImpl.selectModel(true);
1260 1260
1261 return mTabModelSelectorImpl; 1261 return mTabModelSelectorImpl;
1262 } 1262 }
1263 1263
1264 @Override 1264 @Override
1265 protected AppMenuPropertiesDelegate createAppMenuPropertiesDelegate() { 1265 protected AppMenuPropertiesDelegate createAppMenuPropertiesDelegate() {
1266 return new AppMenuPropertiesDelegate(this) { 1266 return new AppMenuPropertiesDelegate(this) {
1267 private boolean showDataSaverFooter() { 1267 private boolean showDataSaverFooter() {
1268 return DataReductionProxySettings.getInstance() 1268 return getBottomSheet() == null
1269 .shouldUseDataReductionMainMenuItem(); 1269 && DataReductionProxySettings.getInstance()
1270 .shouldUseDataReductionMainMenuItem();
1270 } 1271 }
1271 1272
1272 @Override 1273 @Override
1273 public int getFooterResourceId() { 1274 public int getFooterResourceId() {
1275 if (getBottomSheet() != null) {
1276 boolean isPageMenu = !isTablet() && !isInOverviewMode();
1277 return isPageMenu ? R.layout.icon_row_menu_footer : 0;
1278 }
1279
1274 return showDataSaverFooter() ? R.layout.data_reduction_main_menu _footer : 0; 1280 return showDataSaverFooter() ? R.layout.data_reduction_main_menu _footer : 0;
1275 } 1281 }
1276 1282
1277 @Override 1283 @Override
1278 public boolean shouldShowFooter(int maxMenuHeight) { 1284 public boolean shouldShowFooter(int maxMenuHeight) {
1279 if (showDataSaverFooter()) { 1285 if (showDataSaverFooter()) {
1280 return maxMenuHeight >= getResources().getDimension( 1286 return maxMenuHeight >= getResources().getDimension(
1281 R.dimen.data_saver_menu_foot er_min_show_height); 1287 R.dimen.data_saver_menu_foot er_min_show_height);
1282 } 1288 }
1283 return super.shouldShowFooter(maxMenuHeight); 1289 return super.shouldShowFooter(maxMenuHeight);
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 1994
1989 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT IVITY_SERVICE); 1995 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT IVITY_SERVICE);
1990 for (AppTask task : manager.getAppTasks()) { 1996 for (AppTask task : manager.getAppTasks()) {
1991 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); 1997 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task);
1992 if (info == null) continue; 1998 if (info == null) continue;
1993 if (info.id == sMergedInstanceTaskId) return true; 1999 if (info.id == sMergedInstanceTaskId) return true;
1994 } 2000 }
1995 return false; 2001 return false;
1996 } 2002 }
1997 } 2003 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698