Commit f4238a67 authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Remove ApplicationInitialization class.

It has a single method, confusing name, and provides little/no
value.  This just inlines the single method into the one call site.

BUG=876369

Change-Id: I8cc09dec289c14764563265e1da7ab41c5e74cf3
Reviewed-on: https://chromium-review.googlesource.com/c/1394928Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619862}
parent 20a5dff5
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser;
import android.content.res.Resources;
import android.util.TypedValue;
import org.chromium.base.CommandLine;
import org.chromium.chrome.R;
import org.chromium.content_public.common.ContentSwitches;
/**
* Utility class for application level initialization calls.
*/
public final class ApplicationInitialization {
// Prevent instantiation.
private ApplicationInitialization() {
}
/**
* Enable fullscreen related startup flags.
* @param resources Resources to use while calculating initialization constants.
*/
public static void enableFullscreenFlags(Resources resources) {
CommandLine commandLine = CommandLine.getInstance();
if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return;
TypedValue threshold = new TypedValue();
resources.getValue(R.dimen.top_controls_show_threshold, threshold, true);
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToString().toString());
resources.getValue(R.dimen.top_controls_hide_threshold, threshold, true);
commandLine.appendSwitchWithValue(
ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToString().toString());
}
}
......@@ -25,6 +25,7 @@ import android.support.annotation.CallSuper;
import android.support.annotation.Nullable;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......@@ -343,7 +344,17 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
// not go through ChromeLauncherActivity that would have normally triggered this.
mPartnerBrowserRefreshNeeded = !PartnerBrowserCustomizations.isInitialized();
ApplicationInitialization.enableFullscreenFlags(getResources());
CommandLine commandLine = CommandLine.getInstance();
if (!commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) {
TypedValue threshold = new TypedValue();
getResources().getValue(R.dimen.top_controls_show_threshold, threshold, true);
commandLine.appendSwitchWithValue(ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD,
threshold.coerceToString().toString());
getResources().getValue(R.dimen.top_controls_hide_threshold, threshold, true);
commandLine.appendSwitchWithValue(ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD,
threshold.coerceToString().toString());
}
getWindow().setBackgroundDrawable(getBackgroundDrawable());
mFullscreenManager = createFullscreenManager();
......
......@@ -18,7 +18,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/AppHooks.java",
"java/src/org/chromium/chrome/browser/AppHooksModule.java",
"java/src/org/chromium/chrome/browser/AppIndexingUtil.java",
"java/src/org/chromium/chrome/browser/ApplicationInitialization.java",
"java/src/org/chromium/chrome/browser/ApplicationLifetime.java",
"java/src/org/chromium/chrome/browser/AssistStatusHandler.java",
"java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment