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

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

Issue 2715433008: 🏡 Add a ChromeHomeNewTabPage (Closed)
Patch Set: Changes from mdjones@ review Created 3 years, 9 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.SearchManager; 10 import android.app.SearchManager;
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 private InsetObserverView mInsetObserverView; 238 private InsetObserverView mInsetObserverView;
239 private ContextualSearchManager mContextualSearchManager; 239 private ContextualSearchManager mContextualSearchManager;
240 private ReaderModeManager mReaderModeManager; 240 private ReaderModeManager mReaderModeManager;
241 private SnackbarManager mSnackbarManager; 241 private SnackbarManager mSnackbarManager;
242 private DataUseSnackbarController mDataUseSnackbarController; 242 private DataUseSnackbarController mDataUseSnackbarController;
243 private DataReductionPromoSnackbarController mDataReductionPromoSnackbarCont roller; 243 private DataReductionPromoSnackbarController mDataReductionPromoSnackbarCont roller;
244 private AppMenuPropertiesDelegate mAppMenuPropertiesDelegate; 244 private AppMenuPropertiesDelegate mAppMenuPropertiesDelegate;
245 private AppMenuHandler mAppMenuHandler; 245 private AppMenuHandler mAppMenuHandler;
246 private ToolbarManager mToolbarManager; 246 private ToolbarManager mToolbarManager;
247 private BottomSheet mBottomSheet; 247 private BottomSheet mBottomSheet;
248 private FadingBackgroundView mFadingBackgroundView;
248 249
249 // Time in ms that it took took us to inflate the initial layout 250 // Time in ms that it took took us to inflate the initial layout
250 private long mInflateInitialLayoutDurationMs; 251 private long mInflateInitialLayoutDurationMs;
251 252
252 private int mScreenWidthDp; 253 private int mScreenWidthDp;
253 private Runnable mRecordMultiWindowModeScreenWidthRunnable; 254 private Runnable mRecordMultiWindowModeScreenWidthRunnable;
254 255
255 private AssistStatusHandler mAssistStatusHandler; 256 private AssistStatusHandler mAssistStatusHandler;
256 257
257 // A set of views obscuring all tabs. When this set is nonempty, 258 // A set of views obscuring all tabs. When this set is nonempty,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 getFullscreenManager().initialize( 344 getFullscreenManager().initialize(
344 (ControlContainer) findViewById(R.id.control_container), 345 (ControlContainer) findViewById(R.id.control_container),
345 getTabModelSelector(), 346 getTabModelSelector(),
346 getControlContainerHeightResource()); 347 getControlContainerHeightResource());
347 } 348 }
348 349
349 if (mBottomSheet != null) { 350 if (mBottomSheet != null) {
350 mBottomSheet.setTabModelSelector(mTabModelSelector); 351 mBottomSheet.setTabModelSelector(mTabModelSelector);
351 mBottomSheet.setFullscreenManager(mFullscreenManager); 352 mBottomSheet.setFullscreenManager(mFullscreenManager);
352 353
353 FadingBackgroundView fadingView = 354 mFadingBackgroundView = (FadingBackgroundView) findViewById(R.id.fad ing_focus_target);
354 (FadingBackgroundView) findViewById(R.id.fading_focus_target ); 355 mBottomSheet.addObserver(mFadingBackgroundView);
355 mBottomSheet.addObserver(fadingView); 356 mFadingBackgroundView.addObserver(mBottomSheet);
356 fadingView.addObserver(mBottomSheet);
357 } 357 }
358 ((BottomContainer) findViewById(R.id.bottom_container)).initialize(mFull screenManager); 358 ((BottomContainer) findViewById(R.id.bottom_container)).initialize(mFull screenManager);
359 } 359 }
360 360
361 @Override 361 @Override
362 protected View getViewToBeDrawnBeforeInitializingNative() { 362 protected View getViewToBeDrawnBeforeInitializingNative() {
363 View controlContainer = findViewById(R.id.control_container); 363 View controlContainer = findViewById(R.id.control_container);
364 return controlContainer != null ? controlContainer 364 return controlContainer != null ? controlContainer
365 : super.getViewToBeDrawnBeforeInitializingNative(); 365 : super.getViewToBeDrawnBeforeInitializingNative();
366 } 366 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 608
609 /** 609 /**
610 * Get the Chrome Home bottom sheet if it exists. 610 * Get the Chrome Home bottom sheet if it exists.
611 * @return The bottom sheet or null. 611 * @return The bottom sheet or null.
612 */ 612 */
613 public BottomSheet getBottomSheet() { 613 public BottomSheet getBottomSheet() {
614 return mBottomSheet; 614 return mBottomSheet;
615 } 615 }
616 616
617 /** 617 /**
618 * @return The View used to obscure content and bring focus to a foreground view.
619 */
620 public FadingBackgroundView getFadingBackgroundView() {
621 return mFadingBackgroundView;
622 }
623
624 /**
618 * @return {@link AppMenuPropertiesDelegate} instance that the {@link AppMen uHandler} 625 * @return {@link AppMenuPropertiesDelegate} instance that the {@link AppMen uHandler}
619 * should be using in this activity. 626 * should be using in this activity.
620 */ 627 */
621 protected AppMenuPropertiesDelegate createAppMenuPropertiesDelegate() { 628 protected AppMenuPropertiesDelegate createAppMenuPropertiesDelegate() {
622 return new AppMenuPropertiesDelegate(this); 629 return new AppMenuPropertiesDelegate(this);
623 } 630 }
624 631
625 /** 632 /**
626 * @return The assist handler for this activity. 633 * @return The assist handler for this activity.
627 */ 634 */
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", 2027 "Android.MultiWindowMode.IsTabletScreenWidthBelow600",
2021 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); 2028 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP);
2022 2029
2023 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { 2030 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) {
2024 RecordHistogram.recordLinearCountHistogram( 2031 RecordHistogram.recordLinearCountHistogram(
2025 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp, 1, 2032 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp, 1,
2026 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); 2033 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50);
2027 } 2034 }
2028 } 2035 }
2029 } 2036 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698