Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.browser; |
| 18 | |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 19 | import com.android.browser.Tab.LockIcon; |
John Reck | 74830e1 | 2011-03-14 11:43:05 -0700 | [diff] [blame] | 20 | import com.android.browser.UI.DropdownChangeListener; |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 21 | |
John Reck | 74830e1 | 2011-03-14 11:43:05 -0700 | [diff] [blame] | 22 | import android.animation.Animator; |
| 23 | import android.animation.Animator.AnimatorListener; |
| 24 | import android.animation.ObjectAnimator; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 25 | import android.app.Activity; |
John Reck | b9a051b | 2011-03-18 11:55:48 -0700 | [diff] [blame^] | 26 | import android.content.pm.PackageManager; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 27 | import android.content.res.Configuration; |
| 28 | import android.content.res.Resources; |
| 29 | import android.graphics.Bitmap; |
| 30 | import android.graphics.BitmapFactory; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 31 | import android.graphics.drawable.Drawable; |
| 32 | import android.os.Bundle; |
| 33 | import android.text.TextUtils; |
| 34 | import android.util.Log; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 35 | import android.view.Gravity; |
| 36 | import android.view.LayoutInflater; |
| 37 | import android.view.Menu; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 38 | import android.view.View; |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 39 | import android.view.View.OnClickListener; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 40 | import android.view.ViewGroup; |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 41 | import android.view.ViewGroup.LayoutParams; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 42 | import android.view.WindowManager; |
Michael Kolb | 3a69628 | 2010-12-05 13:23:24 -0800 | [diff] [blame] | 43 | import android.view.inputmethod.InputMethodManager; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 44 | import android.webkit.WebChromeClient; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 45 | import android.webkit.WebView; |
| 46 | import android.widget.FrameLayout; |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 47 | import android.widget.ImageButton; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 48 | import android.widget.LinearLayout; |
| 49 | import android.widget.Toast; |
| 50 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 51 | import java.util.List; |
| 52 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 53 | /** |
| 54 | * UI interface definitions |
| 55 | */ |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 56 | public abstract class BaseUi implements UI, WebViewFactory { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 57 | |
| 58 | private static final String LOGTAG = "BaseUi"; |
| 59 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 60 | protected static final FrameLayout.LayoutParams COVER_SCREEN_PARAMS = |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 61 | new FrameLayout.LayoutParams( |
| 62 | ViewGroup.LayoutParams.MATCH_PARENT, |
| 63 | ViewGroup.LayoutParams.MATCH_PARENT); |
| 64 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 65 | protected static final FrameLayout.LayoutParams COVER_SCREEN_GRAVITY_CENTER = |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 66 | new FrameLayout.LayoutParams( |
| 67 | ViewGroup.LayoutParams.MATCH_PARENT, |
| 68 | ViewGroup.LayoutParams.MATCH_PARENT, |
| 69 | Gravity.CENTER); |
| 70 | |
| 71 | Activity mActivity; |
| 72 | UiController mUiController; |
| 73 | TabControl mTabControl; |
Michael Kolb | 377ea31 | 2011-02-17 14:36:56 -0800 | [diff] [blame] | 74 | protected Tab mActiveTab; |
Michael Kolb | 3a69628 | 2010-12-05 13:23:24 -0800 | [diff] [blame] | 75 | private InputMethodManager mInputManager; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 76 | |
| 77 | private Drawable mSecLockIcon; |
| 78 | private Drawable mMixLockIcon; |
| 79 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 80 | private FrameLayout mBrowserFrameLayout; |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 81 | protected FrameLayout mContentView; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 82 | private FrameLayout mCustomViewContainer; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 83 | |
| 84 | private View mCustomView; |
| 85 | private WebChromeClient.CustomViewCallback mCustomViewCallback; |
| 86 | |
| 87 | private CombinedBookmarkHistoryView mComboView; |
| 88 | |
| 89 | private LinearLayout mErrorConsoleContainer = null; |
| 90 | |
| 91 | private Toast mStopToast; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 92 | |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 93 | private boolean mTitleShowing; |
| 94 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 95 | // the default <video> poster |
| 96 | private Bitmap mDefaultVideoPoster; |
| 97 | // the video progress view |
| 98 | private View mVideoProgressView; |
| 99 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 100 | private boolean mActivityPaused; |
| 101 | |
| 102 | public BaseUi(Activity browser, UiController controller) { |
| 103 | mActivity = browser; |
| 104 | mUiController = controller; |
| 105 | mTabControl = controller.getTabControl(); |
| 106 | Resources res = mActivity.getResources(); |
Michael Kolb | 3a69628 | 2010-12-05 13:23:24 -0800 | [diff] [blame] | 107 | mInputManager = (InputMethodManager) |
| 108 | browser.getSystemService(Activity.INPUT_METHOD_SERVICE); |
Michael Kolb | 5a72f18 | 2011-01-13 20:35:06 -0800 | [diff] [blame] | 109 | mSecLockIcon = res.getDrawable(R.drawable.ic_secure_holo_dark); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 110 | mMixLockIcon = res.getDrawable(R.drawable.ic_partial_secure); |
| 111 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 112 | FrameLayout frameLayout = (FrameLayout) mActivity.getWindow() |
| 113 | .getDecorView().findViewById(android.R.id.content); |
| 114 | mBrowserFrameLayout = (FrameLayout) LayoutInflater.from(mActivity) |
| 115 | .inflate(R.layout.custom_screen, null); |
| 116 | mContentView = (FrameLayout) mBrowserFrameLayout.findViewById( |
| 117 | R.id.main_content); |
| 118 | mErrorConsoleContainer = (LinearLayout) mBrowserFrameLayout |
| 119 | .findViewById(R.id.error_console); |
| 120 | mCustomViewContainer = (FrameLayout) mBrowserFrameLayout |
| 121 | .findViewById(R.id.fullscreen_custom_content); |
| 122 | frameLayout.addView(mBrowserFrameLayout, COVER_SCREEN_PARAMS); |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 123 | mTitleShowing = false; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 124 | } |
| 125 | |
John Reck | b9a051b | 2011-03-18 11:55:48 -0700 | [diff] [blame^] | 126 | @Override |
| 127 | public WebView createWebView(boolean privateBrowsing) { |
| 128 | // Create a new WebView |
| 129 | BrowserWebView w = new BrowserWebView(mActivity, null, |
| 130 | android.R.attr.webViewStyle, privateBrowsing); |
| 131 | initWebViewSettings(w); |
| 132 | return w; |
| 133 | } |
| 134 | |
| 135 | @Override |
| 136 | public WebView createSubWebView(boolean privateBrowsing) { |
| 137 | return createWebView(privateBrowsing); |
| 138 | } |
| 139 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 140 | /** |
| 141 | * common webview initialization |
| 142 | * @param w the webview to initialize |
| 143 | */ |
| 144 | protected void initWebViewSettings(WebView w) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 145 | w.setScrollbarFadingEnabled(true); |
| 146 | w.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); |
| 147 | w.setMapTrackballToArrowKeys(false); // use trackball directly |
| 148 | // Enable the built-in zoom |
| 149 | w.getSettings().setBuiltInZoomControls(true); |
John Reck | b9a051b | 2011-03-18 11:55:48 -0700 | [diff] [blame^] | 150 | boolean supportsMultiTouch = mActivity.getPackageManager() |
| 151 | .hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH); |
| 152 | w.getSettings().setDisplayZoomControls(!supportsMultiTouch); |
| 153 | w.setExpandedTileBounds(true); // smoother scrolling |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 154 | |
| 155 | // Add this WebView to the settings observer list and update the |
| 156 | // settings |
| 157 | final BrowserSettings s = BrowserSettings.getInstance(); |
| 158 | s.addObserver(w.getSettings()).update(s, null); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | private void cancelStopToast() { |
| 162 | if (mStopToast != null) { |
| 163 | mStopToast.cancel(); |
| 164 | mStopToast = null; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | // lifecycle |
| 169 | |
| 170 | public void onPause() { |
Michael Kolb | 7a5cf47 | 2010-11-30 13:23:53 -0800 | [diff] [blame] | 171 | if (isCustomViewShowing()) { |
| 172 | onHideCustomView(); |
| 173 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 174 | cancelStopToast(); |
| 175 | mActivityPaused = true; |
| 176 | } |
| 177 | |
| 178 | public void onResume() { |
| 179 | mActivityPaused = false; |
| 180 | } |
| 181 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 182 | protected boolean isActivityPaused() { |
| 183 | return mActivityPaused; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | public void onConfigurationChanged(Configuration config) { |
| 187 | } |
| 188 | |
Michael Kolb | dc2ee1b | 2011-02-14 14:34:40 -0800 | [diff] [blame] | 189 | public abstract void editUrl(boolean clearInput); |
| 190 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 191 | // key handling |
| 192 | |
| 193 | @Override |
| 194 | public boolean onBackKey() { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 195 | if (mComboView != null) { |
| 196 | if (!mComboView.onBackPressed()) { |
| 197 | mUiController.removeComboView(); |
| 198 | } |
| 199 | return true; |
| 200 | } |
| 201 | if (mCustomView != null) { |
| 202 | mUiController.hideCustomView(); |
| 203 | return true; |
| 204 | } |
| 205 | return false; |
| 206 | } |
| 207 | |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 208 | // Tab callbacks |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 209 | @Override |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 210 | public void onTabDataChanged(Tab tab) { |
| 211 | setUrlTitle(tab); |
| 212 | setFavicon(tab); |
| 213 | updateLockIconToLatest(tab); |
Michael Kolb | 5a72f18 | 2011-01-13 20:35:06 -0800 | [diff] [blame] | 214 | updateNavigationState(tab); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | @Override |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 218 | public void bookmarkedStatusHasChanged(Tab tab) { |
John Reck | 94b7e04 | 2011-02-15 15:02:33 -0800 | [diff] [blame] | 219 | if (tab.inForeground()) { |
| 220 | boolean isBookmark = tab.isBookmarkedSite(); |
| 221 | getTitleBar().setCurrentUrlIsBookmark(isBookmark); |
| 222 | } |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 226 | public void onPageStopped(Tab tab) { |
| 227 | cancelStopToast(); |
| 228 | if (tab.inForeground()) { |
| 229 | mStopToast = Toast |
| 230 | .makeText(mActivity, R.string.stopping, Toast.LENGTH_SHORT); |
| 231 | mStopToast.show(); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | @Override |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 236 | public boolean needsRestoreAllTabs() { |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 237 | return false; |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 241 | public void addTab(Tab tab) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | @Override |
Michael Kolb | 377ea31 | 2011-02-17 14:36:56 -0800 | [diff] [blame] | 245 | public void setActiveTab(final Tab tab) { |
| 246 | setActiveTab(tab, true); |
| 247 | } |
| 248 | |
| 249 | void setActiveTab(Tab tab, boolean needsAttaching) { |
Michael Kolb | 77df456 | 2010-11-19 14:49:34 -0800 | [diff] [blame] | 250 | if ((tab != mActiveTab) && (mActiveTab != null)) { |
| 251 | removeTabFromContentView(mActiveTab); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 252 | } |
Michael Kolb | 77df456 | 2010-11-19 14:49:34 -0800 | [diff] [blame] | 253 | mActiveTab = tab; |
Michael Kolb | 377ea31 | 2011-02-17 14:36:56 -0800 | [diff] [blame] | 254 | if (needsAttaching) { |
| 255 | attachTabToContentView(tab); |
| 256 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 257 | setShouldShowErrorConsole(tab, mUiController.shouldShowErrorConsole()); |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 258 | onTabDataChanged(tab); |
| 259 | onProgressChanged(tab); |
John Reck | 117f07d | 2011-01-24 09:39:03 -0800 | [diff] [blame] | 260 | boolean incognito = mActiveTab.getWebView().isPrivateBrowsingEnabled(); |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 261 | getTitleBar().setIncognitoMode(incognito); |
Patrick Scott | 9206677 | 2011-03-10 08:46:27 -0500 | [diff] [blame] | 262 | updateAutoLogin(tab, false); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 263 | } |
| 264 | |
Michael Kolb | cfa3af5 | 2010-12-14 10:36:11 -0800 | [diff] [blame] | 265 | Tab getActiveTab() { |
| 266 | return mActiveTab; |
| 267 | } |
| 268 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 269 | @Override |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 270 | public void updateTabs(List<Tab> tabs) { |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 274 | public void removeTab(Tab tab) { |
Michael Kolb | 77df456 | 2010-11-19 14:49:34 -0800 | [diff] [blame] | 275 | if (mActiveTab == tab) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 276 | removeTabFromContentView(tab); |
Michael Kolb | 77df456 | 2010-11-19 14:49:34 -0800 | [diff] [blame] | 277 | mActiveTab = null; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 278 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | @Override |
| 282 | public void detachTab(Tab tab) { |
| 283 | removeTabFromContentView(tab); |
| 284 | } |
| 285 | |
| 286 | @Override |
| 287 | public void attachTab(Tab tab) { |
| 288 | attachTabToContentView(tab); |
| 289 | } |
| 290 | |
Michael Kolb | 377ea31 | 2011-02-17 14:36:56 -0800 | [diff] [blame] | 291 | protected void attachTabToContentView(Tab tab) { |
Michael Kolb | d1e2ccc | 2011-01-24 11:38:31 -0800 | [diff] [blame] | 292 | if ((tab == null) || (tab.getWebView() == null)) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 293 | return; |
| 294 | } |
| 295 | View container = tab.getViewContainer(); |
| 296 | WebView mainView = tab.getWebView(); |
| 297 | // Attach the WebView to the container and then attach the |
| 298 | // container to the content view. |
| 299 | FrameLayout wrapper = |
| 300 | (FrameLayout) container.findViewById(R.id.webview_wrapper); |
| 301 | ViewGroup parent = (ViewGroup) mainView.getParent(); |
| 302 | if (parent != wrapper) { |
| 303 | if (parent != null) { |
| 304 | Log.w(LOGTAG, "mMainView already has a parent in" |
| 305 | + " attachTabToContentView!"); |
| 306 | parent.removeView(mainView); |
| 307 | } |
| 308 | wrapper.addView(mainView); |
| 309 | } else { |
| 310 | Log.w(LOGTAG, "mMainView is already attached to wrapper in" |
| 311 | + " attachTabToContentView!"); |
| 312 | } |
| 313 | parent = (ViewGroup) container.getParent(); |
| 314 | if (parent != mContentView) { |
| 315 | if (parent != null) { |
| 316 | Log.w(LOGTAG, "mContainer already has a parent in" |
| 317 | + " attachTabToContentView!"); |
| 318 | parent.removeView(container); |
| 319 | } |
| 320 | mContentView.addView(container, COVER_SCREEN_PARAMS); |
| 321 | } else { |
| 322 | Log.w(LOGTAG, "mContainer is already attached to content in" |
| 323 | + " attachTabToContentView!"); |
| 324 | } |
Michael Kolb | a418306 | 2011-01-16 10:43:21 -0800 | [diff] [blame] | 325 | mainView.setNextFocusUpId(R.id.url_focused); |
| 326 | mainView.setNextFocusDownId(R.id.url_focused); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 327 | mUiController.attachSubWindow(tab); |
| 328 | } |
| 329 | |
| 330 | private void removeTabFromContentView(Tab tab) { |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 331 | hideTitleBar(); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 332 | // Remove the container that contains the main WebView. |
| 333 | WebView mainView = tab.getWebView(); |
| 334 | View container = tab.getViewContainer(); |
| 335 | if (mainView == null) { |
| 336 | return; |
| 337 | } |
| 338 | // Remove the container from the content and then remove the |
| 339 | // WebView from the container. This will trigger a focus change |
| 340 | // needed by WebView. |
Michael Kolb | 20776cc | 2011-01-31 10:19:05 -0800 | [diff] [blame] | 341 | mainView.setEmbeddedTitleBar(null); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 342 | FrameLayout wrapper = |
| 343 | (FrameLayout) container.findViewById(R.id.webview_wrapper); |
| 344 | wrapper.removeView(mainView); |
| 345 | mContentView.removeView(container); |
| 346 | mUiController.endActionMode(); |
| 347 | mUiController.removeSubWindow(tab); |
| 348 | ErrorConsoleView errorConsole = tab.getErrorConsole(false); |
| 349 | if (errorConsole != null) { |
| 350 | mErrorConsoleContainer.removeView(errorConsole); |
| 351 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 352 | } |
| 353 | |
Michael Kolb | a713ec8 | 2010-11-29 17:27:06 -0800 | [diff] [blame] | 354 | @Override |
| 355 | public void onSetWebView(Tab tab, WebView webView) { |
| 356 | View container = tab.getViewContainer(); |
| 357 | if (container == null) { |
| 358 | // The tab consists of a container view, which contains the main |
| 359 | // WebView, as well as any other UI elements associated with the tab. |
| 360 | container = mActivity.getLayoutInflater().inflate(R.layout.tab, |
| 361 | null); |
| 362 | tab.setViewContainer(container); |
| 363 | } |
| 364 | if (tab.getWebView() != webView) { |
| 365 | // Just remove the old one. |
| 366 | FrameLayout wrapper = |
| 367 | (FrameLayout) container.findViewById(R.id.webview_wrapper); |
| 368 | wrapper.removeView(tab.getWebView()); |
| 369 | } |
| 370 | } |
| 371 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 372 | /** |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 373 | * create a sub window container and webview for the tab |
| 374 | * Note: this methods operates through side-effects for now |
| 375 | * it sets both the subView and subViewContainer for the given tab |
| 376 | * @param tab tab to create the sub window for |
| 377 | * @param subView webview to be set as a subwindow for the tab |
| 378 | */ |
| 379 | @Override |
| 380 | public void createSubWindow(Tab tab, WebView subView) { |
| 381 | View subViewContainer = mActivity.getLayoutInflater().inflate( |
| 382 | R.layout.browser_subwindow, null); |
| 383 | ViewGroup inner = (ViewGroup) subViewContainer |
| 384 | .findViewById(R.id.inner_container); |
| 385 | inner.addView(subView, new LayoutParams(LayoutParams.MATCH_PARENT, |
| 386 | LayoutParams.MATCH_PARENT)); |
| 387 | final ImageButton cancel = (ImageButton) subViewContainer |
| 388 | .findViewById(R.id.subwindow_close); |
| 389 | final WebView cancelSubView = subView; |
| 390 | cancel.setOnClickListener(new OnClickListener() { |
| 391 | public void onClick(View v) { |
| 392 | cancelSubView.getWebChromeClient().onCloseWindow(cancelSubView); |
| 393 | } |
| 394 | }); |
| 395 | tab.setSubWebView(subView); |
| 396 | tab.setSubViewContainer(subViewContainer); |
| 397 | } |
| 398 | |
| 399 | /** |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 400 | * Remove the sub window from the content view. |
| 401 | */ |
| 402 | @Override |
| 403 | public void removeSubWindow(View subviewContainer) { |
| 404 | mContentView.removeView(subviewContainer); |
| 405 | mUiController.endActionMode(); |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * Attach the sub window to the content view. |
| 410 | */ |
| 411 | @Override |
| 412 | public void attachSubWindow(View container) { |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 413 | if (container.getParent() != null) { |
| 414 | // already attached, remove first |
| 415 | ((ViewGroup) container.getParent()).removeView(container); |
| 416 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 417 | mContentView.addView(container, COVER_SCREEN_PARAMS); |
| 418 | } |
| 419 | |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 420 | boolean canShowTitleBar() { |
| 421 | return !isTitleBarShowing() |
| 422 | && !isActivityPaused() |
| 423 | && (getActiveTab() != null) |
| 424 | && (getActiveTab().getWebView() != null) |
| 425 | && !mUiController.isInCustomActionMode(); |
| 426 | } |
| 427 | |
| 428 | void showTitleBar() { |
| 429 | mTitleShowing = true; |
| 430 | } |
| 431 | |
| 432 | protected void hideTitleBar() { |
| 433 | mTitleShowing = false; |
| 434 | } |
| 435 | |
| 436 | protected boolean isTitleBarShowing() { |
| 437 | return mTitleShowing; |
| 438 | } |
| 439 | |
| 440 | protected abstract TitleBarBase getTitleBar(); |
| 441 | |
| 442 | protected void setTitleGravity(int gravity) { |
| 443 | getTitleBar().setTitleGravity(gravity); |
| 444 | Tab tab = getActiveTab(); |
| 445 | if ((tab != null) && (tab.getWebView() != null)) { |
| 446 | tab.getWebView().setTitleBarGravity(gravity); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 447 | } |
| 448 | } |
| 449 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 450 | @Override |
| 451 | public void showVoiceTitleBar(String title) { |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 452 | getTitleBar().setInVoiceMode(true); |
| 453 | getTitleBar().setDisplayTitle(title); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 454 | } |
| 455 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 456 | @Override |
| 457 | public void revertVoiceTitleBar(Tab tab) { |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 458 | getTitleBar().setInVoiceMode(false); |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 459 | String url = tab.getUrl(); |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 460 | getTitleBar().setDisplayTitle(url); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 461 | } |
| 462 | |
| 463 | @Override |
| 464 | public void showComboView(boolean startWithHistory, Bundle extras) { |
John Reck | 439c9a5 | 2010-12-14 10:04:39 -0800 | [diff] [blame] | 465 | if (mComboView != null) { |
| 466 | return; |
| 467 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 468 | mComboView = new CombinedBookmarkHistoryView(mActivity, |
| 469 | mUiController, |
| 470 | startWithHistory ? |
| 471 | CombinedBookmarkHistoryView.FRAGMENT_ID_HISTORY |
| 472 | : CombinedBookmarkHistoryView.FRAGMENT_ID_BOOKMARKS, |
| 473 | extras); |
Michael Kolb | 47d63f8 | 2011-01-18 10:48:40 -0800 | [diff] [blame] | 474 | FrameLayout wrapper = |
| 475 | (FrameLayout) mContentView.findViewById(R.id.webview_wrapper); |
| 476 | wrapper.setVisibility(View.GONE); |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 477 | hideTitleBar(); |
Michael Kolb | 3a69628 | 2010-12-05 13:23:24 -0800 | [diff] [blame] | 478 | dismissIME(); |
| 479 | if (mActiveTab != null) { |
| 480 | WebView web = mActiveTab.getWebView(); |
| 481 | mActiveTab.putInBackground(); |
| 482 | } |
John Reck | 74830e1 | 2011-03-14 11:43:05 -0700 | [diff] [blame] | 483 | mComboView.setAlpha(0f); |
| 484 | ObjectAnimator anim = ObjectAnimator.ofFloat(mComboView, "alpha", 0f, 1f); |
| 485 | Resources res = mActivity.getResources(); |
| 486 | anim.setDuration(res.getInteger(R.integer.comboViewFadeInDuration)); |
| 487 | anim.start(); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 488 | mContentView.addView(mComboView, COVER_SCREEN_PARAMS); |
| 489 | } |
| 490 | |
Michael Kolb | ba23870 | 2011-03-08 10:40:50 -0800 | [diff] [blame] | 491 | public boolean isComboViewShowing() { |
| 492 | return (mComboView != null); |
| 493 | } |
| 494 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 495 | /** |
| 496 | * dismiss the ComboPage |
| 497 | */ |
| 498 | @Override |
| 499 | public void hideComboView() { |
| 500 | if (mComboView != null) { |
| 501 | mContentView.removeView(mComboView); |
Michael Kolb | 47d63f8 | 2011-01-18 10:48:40 -0800 | [diff] [blame] | 502 | FrameLayout wrapper = |
| 503 | (FrameLayout) mContentView.findViewById(R.id.webview_wrapper); |
| 504 | wrapper.setVisibility(View.VISIBLE); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 505 | mComboView = null; |
| 506 | } |
Michael Kolb | 3a69628 | 2010-12-05 13:23:24 -0800 | [diff] [blame] | 507 | if (mActiveTab != null) { |
| 508 | mActiveTab.putInForeground(); |
| 509 | } |
John Reck | b3417f0 | 2011-01-14 11:01:05 -0800 | [diff] [blame] | 510 | mActivity.invalidateOptionsMenu(); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 511 | } |
| 512 | |
| 513 | @Override |
| 514 | public void showCustomView(View view, |
| 515 | WebChromeClient.CustomViewCallback callback) { |
| 516 | // if a view already exists then immediately terminate the new one |
| 517 | if (mCustomView != null) { |
| 518 | callback.onCustomViewHidden(); |
| 519 | return; |
| 520 | } |
| 521 | |
| 522 | // Add the custom view to its container. |
| 523 | mCustomViewContainer.addView(view, COVER_SCREEN_GRAVITY_CENTER); |
| 524 | mCustomView = view; |
| 525 | mCustomViewCallback = callback; |
| 526 | // Hide the content view. |
| 527 | mContentView.setVisibility(View.GONE); |
| 528 | // Finally show the custom view container. |
| 529 | setStatusBarVisibility(false); |
| 530 | mCustomViewContainer.setVisibility(View.VISIBLE); |
| 531 | mCustomViewContainer.bringToFront(); |
| 532 | } |
| 533 | |
| 534 | @Override |
| 535 | public void onHideCustomView() { |
| 536 | if (mCustomView == null) |
| 537 | return; |
| 538 | |
| 539 | // Hide the custom view. |
| 540 | mCustomView.setVisibility(View.GONE); |
| 541 | // Remove the custom view from its container. |
| 542 | mCustomViewContainer.removeView(mCustomView); |
| 543 | mCustomView = null; |
| 544 | mCustomViewContainer.setVisibility(View.GONE); |
| 545 | mCustomViewCallback.onCustomViewHidden(); |
| 546 | // Show the content view. |
| 547 | setStatusBarVisibility(true); |
| 548 | mContentView.setVisibility(View.VISIBLE); |
| 549 | } |
| 550 | |
| 551 | @Override |
| 552 | public boolean isCustomViewShowing() { |
| 553 | return mCustomView != null; |
| 554 | } |
| 555 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 556 | protected void dismissIME() { |
Michael Kolb | 3a69628 | 2010-12-05 13:23:24 -0800 | [diff] [blame] | 557 | if (mInputManager.isActive()) { |
| 558 | mInputManager.hideSoftInputFromWindow(mContentView.getWindowToken(), |
| 559 | 0); |
| 560 | } |
| 561 | } |
| 562 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 563 | @Override |
| 564 | public boolean showsWeb() { |
| 565 | return mCustomView == null |
| 566 | && mComboView == null; |
| 567 | } |
| 568 | |
Patrick Scott | 9206677 | 2011-03-10 08:46:27 -0500 | [diff] [blame] | 569 | @Override |
| 570 | public void showAutoLogin(Tab tab) { |
| 571 | updateAutoLogin(tab, true); |
| 572 | } |
| 573 | |
| 574 | @Override |
| 575 | public void hideAutoLogin(Tab tab) { |
| 576 | updateAutoLogin(tab, true); |
| 577 | } |
| 578 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 579 | // ------------------------------------------------------------------------- |
| 580 | |
Michael Kolb | 5a72f18 | 2011-01-13 20:35:06 -0800 | [diff] [blame] | 581 | protected void updateNavigationState(Tab tab) { |
| 582 | } |
| 583 | |
Patrick Scott | 9206677 | 2011-03-10 08:46:27 -0500 | [diff] [blame] | 584 | protected void updateAutoLogin(Tab tab, boolean animate) {} |
| 585 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 586 | /** |
| 587 | * Update the lock icon to correspond to our latest state. |
| 588 | */ |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 589 | protected void updateLockIconToLatest(Tab t) { |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 590 | if (t != null && t.inForeground()) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 591 | updateLockIconImage(t.getLockIconType()); |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | /** |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 596 | * Updates the lock-icon image in the title-bar. |
| 597 | */ |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 598 | private void updateLockIconImage(LockIcon lockIconType) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 599 | Drawable d = null; |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 600 | if (lockIconType == LockIcon.LOCK_ICON_SECURE) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 601 | d = mSecLockIcon; |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 602 | } else if (lockIconType == LockIcon.LOCK_ICON_MIXED) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 603 | d = mMixLockIcon; |
| 604 | } |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 605 | getTitleBar().setLock(d); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 606 | } |
| 607 | |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 608 | protected void setUrlTitle(Tab tab) { |
| 609 | String url = tab.getUrl(); |
| 610 | String title = tab.getTitle(); |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 611 | if (TextUtils.isEmpty(title)) { |
| 612 | title = url; |
Michael Kolb | 81b6f83 | 2010-12-12 12:44:27 -0800 | [diff] [blame] | 613 | } |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 614 | if (tab.isInVoiceSearchMode()) return; |
| 615 | if (tab.inForeground()) { |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 616 | getTitleBar().setDisplayTitle(url); |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 617 | } |
| 618 | } |
| 619 | |
| 620 | // Set the favicon in the title bar. |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 621 | protected void setFavicon(Tab tab) { |
| 622 | if (tab.inForeground()) { |
| 623 | Bitmap icon = tab.getFavicon(); |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 624 | getTitleBar().setFavicon(icon); |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 625 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 626 | } |
| 627 | |
| 628 | @Override |
| 629 | public void onActionModeFinished(boolean inLoad) { |
| 630 | if (inLoad) { |
| 631 | // the titlebar was removed when the CAB was shown |
| 632 | // if the page is loading, show it again |
Michael Kolb | 7cdc490 | 2011-02-03 17:54:40 -0800 | [diff] [blame] | 633 | showTitleBar(); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 634 | } |
| 635 | } |
| 636 | |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 637 | // active tabs page |
| 638 | |
| 639 | public void showActiveTabsPage() { |
| 640 | } |
| 641 | |
| 642 | /** |
| 643 | * Remove the active tabs page. |
| 644 | */ |
| 645 | public void removeActiveTabsPage() { |
| 646 | } |
| 647 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 648 | // menu handling callbacks |
| 649 | |
| 650 | @Override |
Michael Kolb | 1acef69 | 2011-03-08 14:12:06 -0800 | [diff] [blame] | 651 | public boolean onPrepareOptionsMenu(Menu menu) { |
| 652 | return true; |
| 653 | } |
| 654 | |
| 655 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 656 | public void onOptionsMenuOpened() { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | @Override |
| 660 | public void onExtendedMenuOpened() { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 661 | } |
| 662 | |
| 663 | @Override |
| 664 | public void onOptionsMenuClosed(boolean inLoad) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 665 | } |
| 666 | |
| 667 | @Override |
| 668 | public void onExtendedMenuClosed(boolean inLoad) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 669 | } |
| 670 | |
| 671 | @Override |
| 672 | public void onContextMenuCreated(Menu menu) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 673 | } |
| 674 | |
| 675 | @Override |
| 676 | public void onContextMenuClosed(Menu menu, boolean inLoad) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 677 | } |
| 678 | |
| 679 | // error console |
| 680 | |
| 681 | @Override |
| 682 | public void setShouldShowErrorConsole(Tab tab, boolean flag) { |
Michael Kolb | 9fcefd1 | 2011-02-17 10:55:59 -0800 | [diff] [blame] | 683 | if (tab == null) return; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 684 | ErrorConsoleView errorConsole = tab.getErrorConsole(true); |
| 685 | if (flag) { |
| 686 | // Setting the show state of the console will cause it's the layout |
| 687 | // to be inflated. |
| 688 | if (errorConsole.numberOfErrors() > 0) { |
| 689 | errorConsole.showConsole(ErrorConsoleView.SHOW_MINIMIZED); |
| 690 | } else { |
| 691 | errorConsole.showConsole(ErrorConsoleView.SHOW_NONE); |
| 692 | } |
| 693 | if (errorConsole.getParent() != null) { |
| 694 | mErrorConsoleContainer.removeView(errorConsole); |
| 695 | } |
| 696 | // Now we can add it to the main view. |
| 697 | mErrorConsoleContainer.addView(errorConsole, |
| 698 | new LinearLayout.LayoutParams( |
| 699 | ViewGroup.LayoutParams.MATCH_PARENT, |
| 700 | ViewGroup.LayoutParams.WRAP_CONTENT)); |
| 701 | } else { |
| 702 | mErrorConsoleContainer.removeView(errorConsole); |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | private void setStatusBarVisibility(boolean visible) { |
Joe Onorato | d3bf86f | 2011-01-25 20:07:10 -0800 | [diff] [blame] | 707 | WindowManager.LayoutParams params = mActivity.getWindow().getAttributes(); |
| 708 | params.systemUiVisibility = visible ? View.STATUS_BAR_VISIBLE : View.STATUS_BAR_HIDDEN; |
| 709 | mActivity.getWindow().setAttributes(params); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 710 | } |
| 711 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 712 | // ------------------------------------------------------------------------- |
| 713 | // Helper function for WebChromeClient |
| 714 | // ------------------------------------------------------------------------- |
| 715 | |
| 716 | @Override |
| 717 | public Bitmap getDefaultVideoPoster() { |
| 718 | if (mDefaultVideoPoster == null) { |
| 719 | mDefaultVideoPoster = BitmapFactory.decodeResource( |
| 720 | mActivity.getResources(), R.drawable.default_video_poster); |
| 721 | } |
| 722 | return mDefaultVideoPoster; |
| 723 | } |
| 724 | |
| 725 | @Override |
| 726 | public View getVideoLoadingProgressView() { |
| 727 | if (mVideoProgressView == null) { |
| 728 | LayoutInflater inflater = LayoutInflater.from(mActivity); |
| 729 | mVideoProgressView = inflater.inflate( |
| 730 | R.layout.video_loading_progress, null); |
| 731 | } |
| 732 | return mVideoProgressView; |
| 733 | } |
| 734 | |
Michael Kolb | 843510f | 2010-12-09 10:51:49 -0800 | [diff] [blame] | 735 | @Override |
| 736 | public void showMaxTabsWarning() { |
| 737 | Toast warning = Toast.makeText(mActivity, |
| 738 | mActivity.getString(R.string.max_tabs_warning), |
| 739 | Toast.LENGTH_SHORT); |
| 740 | warning.show(); |
| 741 | } |
| 742 | |
Narayan Kamath | 5119edd | 2011-02-23 15:49:17 +0000 | [diff] [blame] | 743 | @Override |
| 744 | public void registerDropdownChangeListener(DropdownChangeListener d) { |
| 745 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 746 | } |