OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.app.ActivityManager; | 7 import android.app.ActivityManager; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.res.Resources; | 9 import android.content.res.Resources; |
10 import android.graphics.Point; | 10 import android.graphics.Point; |
11 import android.util.Log; | 11 import android.util.Log; |
12 import android.view.WindowManager; | 12 import android.view.WindowManager; |
13 import android.view.Display; | 13 import android.view.Display; |
14 | 14 |
15 import org.chromium.base.JNINamespace; | 15 import org.chromium.base.JNINamespace; |
16 import org.chromium.content.app.AppResource; | |
17 import org.chromium.content.app.ContentMain; | 16 import org.chromium.content.app.ContentMain; |
18 import org.chromium.content.app.LibraryLoader; | 17 import org.chromium.content.app.LibraryLoader; |
19 import org.chromium.content.common.CommandLine; | 18 import org.chromium.content.common.CommandLine; |
| 19 import org.chromium.content.R; |
20 | 20 |
21 // NOTE: This file hasn't been fully upstreamed, please don't merge to downstrea
m. | 21 // NOTE: This file hasn't been fully upstreamed, please don't merge to downstrea
m. |
22 @JNINamespace("content") | 22 @JNINamespace("content") |
23 public class AndroidBrowserProcess { | 23 public class AndroidBrowserProcess { |
24 | 24 |
25 private static final String TAG = "BrowserProcessMain"; | 25 private static final String TAG = "BrowserProcessMain"; |
26 | 26 |
27 // Prevents initializing the process more than once. | 27 // Prevents initializing the process more than once. |
28 private static boolean sInitialized = false; | 28 private static boolean sInitialized = false; |
29 | 29 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 Context appContext = context.getApplicationContext(); | 111 Context appContext = context.getApplicationContext(); |
112 | 112 |
113 // This block is inside genericChromiumProcessInit() instead | 113 // This block is inside genericChromiumProcessInit() instead |
114 // of initChromiumBrowserProcess() to make sure we do it once. | 114 // of initChromiumBrowserProcess() to make sure we do it once. |
115 // In here it is protected with the sInitialized. | 115 // In here it is protected with the sInitialized. |
116 if (hostIsChrome) { | 116 if (hostIsChrome) { |
117 if (nativeIsOfficialBuild() || | 117 if (nativeIsOfficialBuild() || |
118 CommandLine.getInstance().hasSwitch(CommandLine.ADD_OFFICIAL
_COMMAND_LINE)) { | 118 CommandLine.getInstance().hasSwitch(CommandLine.ADD_OFFICIAL
_COMMAND_LINE)) { |
119 Resources res = context.getResources(); | 119 Resources res = context.getResources(); |
120 try { | 120 try { |
121 String[] switches = res.getStringArray(AppResource.ARRAY_OFF
ICIAL_COMMAND_LINE); | 121 String[] switches = res.getStringArray(R.array.official_comm
and_line); |
122 CommandLine.getInstance().appendSwitchesAndArguments(switche
s); | 122 CommandLine.getInstance().appendSwitchesAndArguments(switche
s); |
123 } catch (Resources.NotFoundException e) { | 123 } catch (Resources.NotFoundException e) { |
124 // Do nothing. It is fine to have no command line | 124 // Do nothing. It is fine to have no command line |
125 // additions for an official build. | 125 // additions for an official build. |
126 } | 126 } |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 // For very high resolution displays (eg. Nexus 10), set the default til
e size | 130 // For very high resolution displays (eg. Nexus 10), set the default til
e size |
131 // to be 512. This should be removed in favour of a generic hueristic th
at works | 131 // to be 512. This should be removed in favour of a generic hueristic th
at works |
(...skipping 29 matching lines...) Expand all Loading... |
161 } | 161 } |
162 | 162 |
163 private static native void nativeSetCommandLineFlags( | 163 private static native void nativeSetCommandLineFlags( |
164 int maxRenderProcesses); | 164 int maxRenderProcesses); |
165 | 165 |
166 // Is this an official build of Chrome? Only native code knows | 166 // Is this an official build of Chrome? Only native code knows |
167 // for sure. Official build knowledge is needed very early in | 167 // for sure. Official build knowledge is needed very early in |
168 // process startup. | 168 // process startup. |
169 private static native boolean nativeIsOfficialBuild(); | 169 private static native boolean nativeIsOfficialBuild(); |
170 } | 170 } |
OLD | NEW |