| 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.ui; | 5 package org.chromium.ui; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.ActivityNotFoundException; | 8 import android.content.ActivityNotFoundException; |
| 9 import android.content.ContentResolver; | 9 import android.content.ContentResolver; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| 11 import android.content.Intent; | 11 import android.content.Intent; |
| 12 import android.os.Bundle; | 12 import android.os.Bundle; |
| 13 import android.util.SparseArray; | 13 import android.util.SparseArray; |
| 14 import android.view.WindowManager; | |
| 15 import android.widget.Toast; | 14 import android.widget.Toast; |
| 16 | 15 |
| 17 import java.util.HashMap; | 16 import java.util.HashMap; |
| 18 | 17 |
| 19 import org.chromium.base.JNINamespace; | 18 import org.chromium.base.JNINamespace; |
| 20 | 19 |
| 21 /** | 20 /** |
| 22 * The window base class that has the minimum functionality. | 21 * The window base class that has the minimum functionality. |
| 23 */ | 22 */ |
| 24 @JNINamespace("ui") | 23 @JNINamespace("ui") |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 * the object has not been previously initialized. | 192 * the object has not been previously initialized. |
| 194 * @return A pointer to the c++ AndroidWindow. | 193 * @return A pointer to the c++ AndroidWindow. |
| 195 */ | 194 */ |
| 196 public int getNativePointer() { | 195 public int getNativePointer() { |
| 197 if (mNativeWindowAndroid == 0) { | 196 if (mNativeWindowAndroid == 0) { |
| 198 mNativeWindowAndroid = nativeInit(); | 197 mNativeWindowAndroid = nativeInit(); |
| 199 } | 198 } |
| 200 return mNativeWindowAndroid; | 199 return mNativeWindowAndroid; |
| 201 } | 200 } |
| 202 | 201 |
| 203 public void keepScreenOn(boolean screenOn) { | |
| 204 if (screenOn) { | |
| 205 mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_
SCREEN_ON); | |
| 206 } else { | |
| 207 mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEE
P_SCREEN_ON); | |
| 208 } | |
| 209 } | |
| 210 | |
| 211 private native int nativeInit(); | 202 private native int nativeInit(); |
| 212 private native void nativeDestroy(int nativeWindowAndroid); | 203 private native void nativeDestroy(int nativeWindowAndroid); |
| 213 | 204 |
| 214 } | 205 } |
| OLD | NEW |