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.Window; | 11 import android.view.Window; |
12 | 12 |
13 /** | 13 /** |
14 * Basic application functionality that should be shared among all browser appli
cations. | 14 * Basic application functionality that should be shared among all browser appli
cations. |
15 */ | 15 */ |
16 public class BaseChromiumApplication extends Application { | 16 public class BaseChromiumApplication extends Application { |
17 private static final String TAG = "cr.base"; | 17 private static final String TAG = "cr.base"; |
18 | 18 |
19 @Override | 19 @Override |
20 protected void attachBaseContext(Context base) { | 20 protected void attachBaseContext(Context base) { |
21 super.attachBaseContext(base); | 21 super.attachBaseContext(base); |
| 22 IncrementalInstall.initialize(this); |
22 } | 23 } |
23 | 24 |
24 /** | 25 /** |
25 * Interface to be implemented by listeners for window focus events. | 26 * Interface to be implemented by listeners for window focus events. |
26 */ | 27 */ |
27 public interface WindowFocusChangedListener { | 28 public interface WindowFocusChangedListener { |
28 /** | 29 /** |
29 * Called when the window focus changes for {@code activity}. | 30 * Called when the window focus changes for {@code activity}. |
30 * @param activity The {@link Activity} that has a window focus changed
event. | 31 * @param activity The {@link Activity} that has a window focus changed
event. |
31 * @param hasFocus Whether or not {@code activity} gained or lost focus. | 32 * @param hasFocus Whether or not {@code activity} gained or lost focus. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 109 |
109 /** | 110 /** |
110 * This must only be called for contexts whose application is a subclass of | 111 * This must only be called for contexts whose application is a subclass of |
111 * {@link BaseChromiumApplication}. | 112 * {@link BaseChromiumApplication}. |
112 */ | 113 */ |
113 @VisibleForTesting | 114 @VisibleForTesting |
114 public static void initCommandLine(Context context) { | 115 public static void initCommandLine(Context context) { |
115 ((BaseChromiumApplication) context.getApplicationContext()).initCommandL
ine(); | 116 ((BaseChromiumApplication) context.getApplicationContext()).initCommandL
ine(); |
116 } | 117 } |
117 } | 118 } |
OLD | NEW |