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.tabmodel; | 5 package org.chromium.chrome.browser.tabmodel; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.SharedPreferences; | 8 import android.content.SharedPreferences; |
9 import android.os.AsyncTask; | 9 import android.os.AsyncTask; |
10 import android.os.StrictMode; | 10 import android.os.StrictMode; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 /** | 104 /** |
105 * Alerted at various stages of operation. | 105 * Alerted at various stages of operation. |
106 */ | 106 */ |
107 public abstract static class TabPersistentStoreObserver { | 107 public abstract static class TabPersistentStoreObserver { |
108 /** | 108 /** |
109 * To be called when the file containing the initial information about t
he TabModels has | 109 * To be called when the file containing the initial information about t
he TabModels has |
110 * been loaded. | 110 * been loaded. |
111 * @param tabCountAtStartup How many tabs there are in the TabModels. | 111 * @param tabCountAtStartup How many tabs there are in the TabModels. |
112 */ | 112 */ |
113 void onInitialized(int tabCountAtStartup) {} | 113 public void onInitialized(int tabCountAtStartup) {} |
114 | 114 |
115 /** | 115 /** |
116 * Called when details about a Tab are read from the metadata file. | 116 * Called when details about a Tab are read from the metadata file. |
117 */ | 117 */ |
118 void onDetailsRead(int index, int id, String url, | 118 public void onDetailsRead(int index, int id, String url, boolean isStand
ardActiveIndex, |
119 boolean isStandardActiveIndex, boolean isIncognitoActiveIndex) {
} | 119 boolean isIncognitoActiveIndex) {} |
120 | 120 |
121 /** | 121 /** |
122 * To be called when the TabStates have all been loaded. | 122 * To be called when the TabStates have all been loaded. |
123 */ | 123 */ |
124 void onStateLoaded() {} | 124 public void onStateLoaded() {} |
125 | 125 |
126 /** | 126 /** |
127 * To be called when the TabState from another instance has been merged. | 127 * To be called when the TabState from another instance has been merged. |
128 */ | 128 */ |
129 void onStateMerged() {} | 129 public void onStateMerged() {} |
130 | 130 |
131 /** | 131 /** |
132 * Called when the metadata file has been saved out asynchronously. | 132 * Called when the metadata file has been saved out asynchronously. |
133 * This currently does not get called when the metadata file is saved ou
t on the UI thread. | 133 * This currently does not get called when the metadata file is saved ou
t on the UI thread. |
134 */ | 134 */ |
135 void onMetadataSavedAsynchronously() {} | 135 public void onMetadataSavedAsynchronously() {} |
136 } | 136 } |
137 | 137 |
138 /** Stores information about a TabModel. */ | 138 /** Stores information about a TabModel. */ |
139 public static class TabModelMetadata { | 139 public static class TabModelMetadata { |
140 public final int index; | 140 public final int index; |
141 public final List<Integer> ids; | 141 public final List<Integer> ids; |
142 public final List<String> urls; | 142 public final List<String> urls; |
143 | 143 |
144 TabModelMetadata(int selectedIndex) { | 144 TabModelMetadata(int selectedIndex) { |
145 index = selectedIndex; | 145 index = selectedIndex; |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 } | 1426 } |
1427 | 1427 |
1428 /** | 1428 /** |
1429 * Sets where the base state directory is in tests. | 1429 * Sets where the base state directory is in tests. |
1430 */ | 1430 */ |
1431 @VisibleForTesting | 1431 @VisibleForTesting |
1432 public static void setBaseStateDirectoryForTests(File directory) { | 1432 public static void setBaseStateDirectoryForTests(File directory) { |
1433 BaseStateDirectoryHolder.sDirectory = directory; | 1433 BaseStateDirectoryHolder.sDirectory = directory; |
1434 } | 1434 } |
1435 } | 1435 } |
OLD | NEW |