| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.base; | 5 package org.chromium.base; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.app.Application; | 8 import android.app.Application; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.os.Bundle; | 10 import android.os.Bundle; |
| 11 import android.view.KeyEvent; | 11 import android.view.KeyEvent; |
| 12 import android.view.Window; | 12 import android.view.Window; |
| 13 | 13 |
| 14 import org.chromium.base.multidex.ChromiumMultiDex; |
| 15 |
| 14 import java.lang.reflect.InvocationHandler; | 16 import java.lang.reflect.InvocationHandler; |
| 15 import java.lang.reflect.InvocationTargetException; | 17 import java.lang.reflect.InvocationTargetException; |
| 16 import java.lang.reflect.Method; | 18 import java.lang.reflect.Method; |
| 17 import java.lang.reflect.Proxy; | 19 import java.lang.reflect.Proxy; |
| 18 | 20 |
| 19 /** | 21 /** |
| 20 * Basic application functionality that should be shared among all browser appli
cations. | 22 * Basic application functionality that should be shared among all browser appli
cations. |
| 21 */ | 23 */ |
| 22 public class BaseChromiumApplication extends Application { | 24 public class BaseChromiumApplication extends Application { |
| 25 |
| 26 private static final String TAG = "cr.base"; |
| 27 |
| 28 @Override |
| 29 protected void attachBaseContext(Context base) { |
| 30 super.attachBaseContext(base); |
| 31 ChromiumMultiDex.install(this); |
| 32 } |
| 33 |
| 23 /** | 34 /** |
| 24 * Interface to be implemented by listeners for window focus events. | 35 * Interface to be implemented by listeners for window focus events. |
| 25 */ | 36 */ |
| 26 public interface WindowFocusChangedListener { | 37 public interface WindowFocusChangedListener { |
| 27 /** | 38 /** |
| 28 * Called when the window focus changes for {@code activity}. | 39 * Called when the window focus changes for {@code activity}. |
| 29 * @param activity The {@link Activity} that has a window focus changed
event. | 40 * @param activity The {@link Activity} that has a window focus changed
event. |
| 30 * @param hasFocus Whether or not {@code activity} gained or lost focus. | 41 * @param hasFocus Whether or not {@code activity} gained or lost focus. |
| 31 */ | 42 */ |
| 32 public void onWindowFocusChanged(Activity activity, boolean hasFocus); | 43 public void onWindowFocusChanged(Activity activity, boolean hasFocus); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 172 |
| 162 /** | 173 /** |
| 163 * This must only be called for contexts whose application is a subclass of | 174 * This must only be called for contexts whose application is a subclass of |
| 164 * {@link BaseChromiumApplication}. | 175 * {@link BaseChromiumApplication}. |
| 165 */ | 176 */ |
| 166 @VisibleForTesting | 177 @VisibleForTesting |
| 167 public static void initCommandLine(Context context) { | 178 public static void initCommandLine(Context context) { |
| 168 ((BaseChromiumApplication) context.getApplicationContext()).initCommandL
ine(); | 179 ((BaseChromiumApplication) context.getApplicationContext()).initCommandL
ine(); |
| 169 }; | 180 }; |
| 170 } | 181 } |
| OLD | NEW |