OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.chrome.browser.tab; | 5 package org.chromium.chrome.browser.tab; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.app.ActivityManager; | 9 import android.app.ActivityManager; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 Tab tab = new Tab(id, parentId, incognito, activity, nativeWindow, type,
null); | 3208 Tab tab = new Tab(id, parentId, incognito, activity, nativeWindow, type,
null); |
3209 if (activity != null) { | 3209 if (activity != null) { |
3210 tab.setTabUma(new TabUma(tab, initiallyHidden ? TabCreationState.LIV
E_IN_BACKGROUND | 3210 tab.setTabUma(new TabUma(tab, initiallyHidden ? TabCreationState.LIV
E_IN_BACKGROUND |
3211 : TabCreationState.LIV
E_IN_FOREGROUND, | 3211 : TabCreationState.LIV
E_IN_FOREGROUND, |
3212 tabModelSelector.getModel(incognito))); | 3212 tabModelSelector.getModel(incognito))); |
3213 } | 3213 } |
3214 return tab; | 3214 return tab; |
3215 } | 3215 } |
3216 | 3216 |
3217 /** | 3217 /** |
| 3218 * @return The default toolbar color for this tab. |
| 3219 */ |
| 3220 public int getDefaultThemeColor() { |
| 3221 return mDefaultThemeColor; |
| 3222 } |
| 3223 |
| 3224 /** |
3218 * @return Intent that tells Chrome to bring an Activity for a particular Ta
b back to the | 3225 * @return Intent that tells Chrome to bring an Activity for a particular Ta
b back to the |
3219 * foreground, or null if this isn't possible. | 3226 * foreground, or null if this isn't possible. |
3220 */ | 3227 */ |
3221 public static Intent createBringTabToFrontIntent(int tabId) { | 3228 public static Intent createBringTabToFrontIntent(int tabId) { |
3222 // Iterate through all {@link CustomTab}s and check whether the given ta
bId belongs to a | 3229 // Iterate through all {@link CustomTab}s and check whether the given ta
bId belongs to a |
3223 // {@link CustomTab}. If so, return null as the client app's task cannot
be foregrounded. | 3230 // {@link CustomTab}. If so, return null as the client app's task cannot
be foregrounded. |
3224 List<WeakReference<Activity>> list = ApplicationStatus.getRunningActivit
ies(); | 3231 List<WeakReference<Activity>> list = ApplicationStatus.getRunningActivit
ies(); |
3225 for (WeakReference<Activity> ref : list) { | 3232 for (WeakReference<Activity> ref : list) { |
3226 Activity activity = ref.get(); | 3233 Activity activity = ref.get(); |
3227 if (activity instanceof CustomTabActivity | 3234 if (activity instanceof CustomTabActivity |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid
, | 3327 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid
, |
3321 ContentViewCore content, boolean visible); | 3328 ContentViewCore content, boolean visible); |
3322 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid
, | 3329 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid
, |
3323 ContentViewCore content); | 3330 ContentViewCore content); |
3324 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); | 3331 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); |
3325 private native void nativeOnRendererUnresponsive(long nativeTabAndroid); | 3332 private native void nativeOnRendererUnresponsive(long nativeTabAndroid); |
3326 private native void nativeOnRendererResponsive(long nativeTabAndroid); | 3333 private native void nativeOnRendererResponsive(long nativeTabAndroid); |
3327 | 3334 |
3328 private static native void nativeRecordStartupToCommitUma(); | 3335 private static native void nativeRecordStartupToCommitUma(); |
3329 } | 3336 } |
OLD | NEW |