blob: 6225ad49f8cd4f5e1f90a38c50d0c3d5df34dadb [file] [log] [blame]
Michael Kolb66706532010-12-12 19:50:22 -08001/*
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
17package com.android.browser;
18
19import com.android.browser.ScrollWebView.ScrollListener;
20
Michael Kolb377ea312011-02-17 14:36:56 -080021import android.animation.Animator;
22import android.animation.Animator.AnimatorListener;
23import android.animation.ObjectAnimator;
Michael Kolb66706532010-12-12 19:50:22 -080024import android.app.ActionBar;
25import android.app.Activity;
Michael Kolb24915222011-02-24 11:38:49 -080026import android.content.pm.PackageManager;
Michael Kolbac35bdc2011-01-17 17:06:04 -080027import android.os.Bundle;
Michael Kolbba238702011-03-08 10:40:50 -080028import android.os.Handler;
Michael Kolb376b5412010-12-15 11:52:57 -080029import android.util.Log;
Michael Kolb66706532010-12-12 19:50:22 -080030import android.view.ActionMode;
Michael Kolb376b5412010-12-15 11:52:57 -080031import android.view.Gravity;
Michael Kolba4183062011-01-16 10:43:21 -080032import android.view.KeyEvent;
John Reckd73c5a22010-12-22 10:22:50 -080033import android.view.View;
34import android.webkit.WebChromeClient.CustomViewCallback;
Michael Kolb66706532010-12-12 19:50:22 -080035import android.webkit.WebView;
Michael Kolb2a56eca2011-02-25 09:45:06 -080036import android.widget.FrameLayout;
Michael Kolb66706532010-12-12 19:50:22 -080037
38import java.util.List;
39
40/**
41 * Ui for xlarge screen sizes
42 */
43public class XLargeUi extends BaseUi implements ScrollListener {
44
45 private static final String LOGTAG = "XLargeUi";
46
Michael Kolb376b5412010-12-15 11:52:57 -080047 private ActionBar mActionBar;
Michael Kolb66706532010-12-12 19:50:22 -080048 private TabBar mTabBar;
49
50 private TitleBarXLarge mTitleBar;
Michael Kolb66706532010-12-12 19:50:22 -080051
Michael Kolb376b5412010-12-15 11:52:57 -080052 private boolean mUseQuickControls;
53 private PieControl mPieControl;
Michael Kolbd72f1592011-03-03 16:30:25 -080054 private boolean mInAnimation = false;
Michael Kolbba238702011-03-08 10:40:50 -080055 private Handler mHandler;
Michael Kolb376b5412010-12-15 11:52:57 -080056
Michael Kolb66706532010-12-12 19:50:22 -080057 /**
58 * @param browser
59 * @param controller
60 */
61 public XLargeUi(Activity browser, UiController controller) {
62 super(browser, controller);
Michael Kolbba238702011-03-08 10:40:50 -080063 mHandler = new Handler();
Michael Kolb66706532010-12-12 19:50:22 -080064 mTitleBar = new TitleBarXLarge(mActivity, mUiController, this);
65 mTitleBar.setProgress(100);
Michael Kolb66706532010-12-12 19:50:22 -080066 mTabBar = new TabBar(mActivity, mUiController, this);
Michael Kolb376b5412010-12-15 11:52:57 -080067 mActionBar = mActivity.getActionBar();
John Reckb3417f02011-01-14 11:01:05 -080068 setupActionBar();
69 setUseQuickControls(BrowserSettings.getInstance().useQuickControls());
70 }
71
72 private void setupActionBar() {
73 mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
Michael Kolb376b5412010-12-15 11:52:57 -080074 mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
75 mActionBar.setCustomView(mTabBar);
John Reckb3417f02011-01-14 11:01:05 -080076 }
77
78 @Override
Michael Kolbac35bdc2011-01-17 17:06:04 -080079 public void showComboView(boolean startWithHistory, Bundle extras) {
80 super.showComboView(startWithHistory, extras);
81 if (mUseQuickControls) {
82 mActionBar.show();
83 }
84 }
85
86 @Override
John Reckb3417f02011-01-14 11:01:05 -080087 public void hideComboView() {
Michael Kolbba238702011-03-08 10:40:50 -080088 if (isComboViewShowing()) {
89 super.hideComboView();
90 // ComboView changes the action bar, set it back up to what we want
91 setupActionBar();
92 checkTabCount();
93 }
Michael Kolb376b5412010-12-15 11:52:57 -080094 }
95
96 private void setUseQuickControls(boolean useQuickControls) {
97 mUseQuickControls = useQuickControls;
Michael Kolb7cdc4902011-02-03 17:54:40 -080098 mTitleBar.setUseQuickControls(mUseQuickControls);
Michael Kolb376b5412010-12-15 11:52:57 -080099 if (useQuickControls) {
100 checkTabCount();
101 mPieControl = new PieControl(mActivity, mUiController, this);
102 mPieControl.attachToContainer(mContentView);
Michael Kolb7cdc4902011-02-03 17:54:40 -0800103 Tab tab = getActiveTab();
104 if ((tab != null) && (tab.getWebView() != null)) {
105 tab.getWebView().setEmbeddedTitleBar(null);
Michael Kolb376b5412010-12-15 11:52:57 -0800106 }
Michael Kolb7cdc4902011-02-03 17:54:40 -0800107 setTitleGravity(Gravity.BOTTOM);
Michael Kolb376b5412010-12-15 11:52:57 -0800108 } else {
109 mActivity.getActionBar().show();
110 if (mPieControl != null) {
111 mPieControl.removeFromContainer(mContentView);
112 }
Michael Kolb7cdc4902011-02-03 17:54:40 -0800113 setTitleGravity(Gravity.TOP);
Michael Kolb376b5412010-12-15 11:52:57 -0800114 WebView web = mTabControl.getCurrentWebView();
Michael Kolb7cdc4902011-02-03 17:54:40 -0800115 if (web != null) {
Michael Kolb376b5412010-12-15 11:52:57 -0800116 web.setEmbeddedTitleBar(mTitleBar);
117 }
118 }
119 mTabBar.setUseQuickControls(mUseQuickControls);
Michael Kolb376b5412010-12-15 11:52:57 -0800120 }
121
122 private void checkTabCount() {
123 if (mUseQuickControls) {
124 int n = mTabBar.getTabCount();
125 if (n >= 2) {
Michael Kolbba238702011-03-08 10:40:50 -0800126 mActionBar.show();
Michael Kolb376b5412010-12-15 11:52:57 -0800127 } else if (n == 1) {
Michael Kolbba238702011-03-08 10:40:50 -0800128 mHandler.post(new Runnable() {
129 public void run() {
130 mActionBar.hide();
131 }
132 });
Michael Kolb376b5412010-12-15 11:52:57 -0800133 }
134 }
Michael Kolb66706532010-12-12 19:50:22 -0800135 }
136
137 @Override
138 public void onDestroy() {
Michael Kolb7cdc4902011-02-03 17:54:40 -0800139 hideTitleBar();
Michael Kolb66706532010-12-12 19:50:22 -0800140 }
141
142 // webview factory
143
144 @Override
145 public WebView createWebView(boolean privateBrowsing) {
146 // Create a new WebView
147 ScrollWebView w = new ScrollWebView(mActivity, null,
148 android.R.attr.webViewStyle, privateBrowsing);
149 initWebViewSettings(w);
150 w.setScrollListener(this);
Michael Kolb24915222011-02-24 11:38:49 -0800151 boolean supportsMultiTouch = mActivity.getPackageManager()
152 .hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
153 w.getSettings().setDisplayZoomControls(!supportsMultiTouch);
Dave Burke20b6f1f2011-02-01 12:59:04 +0000154 w.setExpandedTileBounds(true); // smoother scrolling
Michael Kolb66706532010-12-12 19:50:22 -0800155 return w;
156 }
157
158 @Override
159 public WebView createSubWebView(boolean privateBrowsing) {
160 ScrollWebView web = (ScrollWebView) createWebView(privateBrowsing);
161 // no scroll listener for subview
162 web.setScrollListener(null);
163 return web;
164 }
165
166 @Override
Michael Kolb5ee018e2011-02-18 15:47:21 -0800167 public void onScroll(int visibleTitleHeight, boolean userInitiated) {
168 mTabBar.onScroll(visibleTitleHeight, userInitiated);
Michael Kolb66706532010-12-12 19:50:22 -0800169 }
170
171 void stopWebViewScrolling() {
172 ScrollWebView web = (ScrollWebView) mUiController.getCurrentWebView();
173 if (web != null) {
174 web.stopScroll();
175 }
176 }
177
178 // WebView callbacks
179
180 @Override
John Reck30c714c2010-12-16 17:30:34 -0800181 public void onProgressChanged(Tab tab) {
182 int progress = tab.getLoadProgress();
Michael Kolb66706532010-12-12 19:50:22 -0800183 mTabBar.onProgress(tab, progress);
184 if (tab.inForeground()) {
Michael Kolb7cdc4902011-02-03 17:54:40 -0800185 mTitleBar.setProgress(progress);
Michael Kolb66706532010-12-12 19:50:22 -0800186 if (progress == 100) {
Michael Kolb7cdc4902011-02-03 17:54:40 -0800187 if (!mTitleBar.isEditingUrl()) {
188 hideTitleBar();
Michael Kolbbd018d42010-12-15 15:43:39 -0800189 if (mUseQuickControls) {
Michael Kolb7cdc4902011-02-03 17:54:40 -0800190 mTitleBar.setShowProgressOnly(false);
191 setTitleGravity(Gravity.BOTTOM);
Michael Kolbbd018d42010-12-15 15:43:39 -0800192 }
Michael Kolb376b5412010-12-15 11:52:57 -0800193 }
Michael Kolb66706532010-12-12 19:50:22 -0800194 } else {
Michael Kolb7cdc4902011-02-03 17:54:40 -0800195 if (!isTitleBarShowing()) {
196 if (mUseQuickControls && !mTitleBar.isEditingUrl()) {
197 mTitleBar.setShowProgressOnly(true);
198 setTitleGravity(Gravity.TOP);
Michael Kolb376b5412010-12-15 11:52:57 -0800199 }
Michael Kolb7cdc4902011-02-03 17:54:40 -0800200 showTitleBar();
Michael Kolb376b5412010-12-15 11:52:57 -0800201 }
Michael Kolb66706532010-12-12 19:50:22 -0800202 }
203 }
204 }
205
206 @Override
207 public boolean needsRestoreAllTabs() {
208 return true;
209 }
210
211 @Override
212 public void addTab(Tab tab) {
213 mTabBar.onNewTab(tab);
Michael Kolb8814d732011-01-26 11:22:30 -0800214 }
215
216 protected void onAddTabCompleted(Tab tab) {
Michael Kolb376b5412010-12-15 11:52:57 -0800217 checkTabCount();
Michael Kolb66706532010-12-12 19:50:22 -0800218 }
219
220 @Override
Michael Kolb377ea312011-02-17 14:36:56 -0800221 public void setActiveTab(final Tab tab) {
Michael Kolbd72f1592011-03-03 16:30:25 -0800222 if (mInAnimation) return;
Michael Kolb377ea312011-02-17 14:36:56 -0800223 if ((tab != mActiveTab) && (mActiveTab != null)) {
Michael Kolbd72f1592011-03-03 16:30:25 -0800224 mInAnimation = true;
Michael Kolb377ea312011-02-17 14:36:56 -0800225 // animate between the two
226 final ScrollWebView fromWV = (ScrollWebView) mActiveTab.getWebView();
227 fromWV.setDrawCached(true);
228 fromWV.setEmbeddedTitleBar(null);
229 final ScrollWebView toWV = (ScrollWebView) tab.getWebView();
230 if (!mUseQuickControls) {
231 if (mTitleBar.getParent() == null) {
232 toWV.setEmbeddedTitleBar(mTitleBar);
233 }
234 }
235 toWV.setDrawCached(true);
236 attachTabToContentView(tab);
237 super.setActiveTab(tab, false);
238 ObjectAnimator transition = ObjectAnimator.ofFloat(
239 toWV, "alpha", 0f, 1f);
240 transition.setDuration(mActivity.getResources()
241 .getInteger(R.integer.tabFadeDuration));
242 transition.addListener(new AnimatorListener() {
243 @Override
244 public void onAnimationCancel(Animator animation) {
245 fromWV.setDrawCached(false);
246 toWV.setDrawCached(false);
247 setActiveTab(tab, false);
Michael Kolbd72f1592011-03-03 16:30:25 -0800248 mInAnimation = false;
Michael Kolb377ea312011-02-17 14:36:56 -0800249 }
250
251 @Override
252 public void onAnimationEnd(Animator animation) {
253 fromWV.setDrawCached(false);
254 toWV.setDrawCached(false);
255 setActiveTab(tab, false);
Michael Kolbd72f1592011-03-03 16:30:25 -0800256 mInAnimation = false;
Michael Kolb377ea312011-02-17 14:36:56 -0800257 }
258
259 @Override
260 public void onAnimationRepeat(Animator animation) {
261 }
262
263 @Override
264 public void onAnimationStart(Animator animation) {
265 }
266 });
267 transition.start();
268 } else {
269 super.setActiveTab(tab, true);
270 setActiveTab(tab, true);
Michael Kolb36a1dc92011-02-22 16:14:59 -0800271 }
Michael Kolb377ea312011-02-17 14:36:56 -0800272 }
273
274 @Override
275 void setActiveTab(Tab tab, boolean needsAttaching) {
Michael Kolb376b5412010-12-15 11:52:57 -0800276 ScrollWebView view = (ScrollWebView) tab.getWebView();
277 // TabControl.setCurrentTab has been called before this,
278 // so the tab is guaranteed to have a webview
279 if (view == null) {
280 Log.e(LOGTAG, "active tab with no webview detected");
281 return;
282 }
283 // Request focus on the top window.
284 if (mUseQuickControls) {
285 mPieControl.forceToTop(mContentView);
286 view.setScrollListener(null);
287 mTabBar.showTitleBarIndicator(false);
288 } else {
Michael Kolb377ea312011-02-17 14:36:56 -0800289 // check if title bar is already attached by animation
290 if (mTitleBar.getParent() == null) {
291 view.setEmbeddedTitleBar(mTitleBar);
292 }
Michael Kolb376b5412010-12-15 11:52:57 -0800293 view.setScrollListener(this);
294 }
Michael Kolb66706532010-12-12 19:50:22 -0800295 mTabBar.onSetActiveTab(tab);
Michael Kolb376b5412010-12-15 11:52:57 -0800296 if (tab.isInVoiceSearchMode()) {
297 showVoiceTitleBar(tab.getVoiceDisplayTitle());
298 } else {
299 revertVoiceTitleBar(tab);
300 }
Michael Kolb376b5412010-12-15 11:52:57 -0800301 updateLockIconToLatest(tab);
302 tab.getTopWindow().requestFocus();
Michael Kolb66706532010-12-12 19:50:22 -0800303 }
304
305 @Override
306 public void updateTabs(List<Tab> tabs) {
307 mTabBar.updateTabs(tabs);
Michael Kolb376b5412010-12-15 11:52:57 -0800308 checkTabCount();
Michael Kolb66706532010-12-12 19:50:22 -0800309 }
310
311 @Override
312 public void removeTab(Tab tab) {
313 super.removeTab(tab);
314 mTabBar.onRemoveTab(tab);
Michael Kolb8814d732011-01-26 11:22:30 -0800315 }
316
317 protected void onRemoveTabCompleted(Tab tab) {
Michael Kolb376b5412010-12-15 11:52:57 -0800318 checkTabCount();
Michael Kolb66706532010-12-12 19:50:22 -0800319 }
320
Michael Kolb376b5412010-12-15 11:52:57 -0800321 int getContentWidth() {
322 if (mContentView != null) {
323 return mContentView.getWidth();
Michael Kolb66706532010-12-12 19:50:22 -0800324 }
325 return 0;
326 }
327
Michael Kolbdc2ee1b2011-02-14 14:34:40 -0800328 @Override
329 public void editUrl(boolean clearInput) {
Michael Kolbd72ea3b2011-01-09 15:56:37 -0800330 if (mUiController.isInCustomActionMode()) {
331 mUiController.endActionMode();
332 }
Michael Kolb7cdc4902011-02-03 17:54:40 -0800333 showTitleBar();
Michael Kolbdc2ee1b2011-02-14 14:34:40 -0800334 mTitleBar.startEditingUrl(clearInput);
Michael Kolb66706532010-12-12 19:50:22 -0800335 }
336
Michael Kolb7cdc4902011-02-03 17:54:40 -0800337 void showTitleBarAndEdit() {
338 mTitleBar.setShowProgressOnly(false);
339 showTitleBar();
Michael Kolbdc2ee1b2011-02-14 14:34:40 -0800340 mTitleBar.startEditingUrl(false);
Michael Kolb7cdc4902011-02-03 17:54:40 -0800341 }
342
343 void stopEditingUrl() {
344 mTitleBar.stopEditingUrl();
345 }
346
347 @Override
348 protected void showTitleBar() {
349 if (canShowTitleBar()) {
350 if (mUseQuickControls) {
Michael Kolb7cdc4902011-02-03 17:54:40 -0800351 mContentView.addView(mTitleBar);
352 } else {
353 setTitleGravity(Gravity.TOP);
354 }
355 super.showTitleBar();
356 mTabBar.onShowTitleBar();
Michael Kolb376b5412010-12-15 11:52:57 -0800357 }
Michael Kolb376b5412010-12-15 11:52:57 -0800358 }
359
Michael Kolb66706532010-12-12 19:50:22 -0800360 @Override
Michael Kolb7cdc4902011-02-03 17:54:40 -0800361 protected void hideTitleBar() {
362 if (isTitleBarShowing()) {
Michael Kolb66706532010-12-12 19:50:22 -0800363 mTabBar.onHideTitleBar();
Michael Kolb7cdc4902011-02-03 17:54:40 -0800364 if (mUseQuickControls) {
365 mContentView.removeView(mTitleBar);
Michael Kolb2a56eca2011-02-25 09:45:06 -0800366 } else {
367 setTitleGravity(Gravity.NO_GRAVITY);
Michael Kolb7cdc4902011-02-03 17:54:40 -0800368 }
369 super.hideTitleBar();
Michael Kolb66706532010-12-12 19:50:22 -0800370 }
371 }
372
Michael Kolb5ee018e2011-02-18 15:47:21 -0800373 public boolean isEditingUrl() {
374 return mTitleBar.isEditingUrl();
375 }
376
Michael Kolb66706532010-12-12 19:50:22 -0800377 @Override
Michael Kolb7cdc4902011-02-03 17:54:40 -0800378 protected TitleBarBase getTitleBar() {
Michael Kolb66706532010-12-12 19:50:22 -0800379 return mTitleBar;
380 }
381
Michael Kolb2a56eca2011-02-25 09:45:06 -0800382 @Override
383 protected void setTitleGravity(int gravity) {
384 if (mUseQuickControls) {
385 FrameLayout.LayoutParams lp =
386 (FrameLayout.LayoutParams) mTitleBar.getLayoutParams();
387 lp.gravity = gravity;
388 mTitleBar.setLayoutParams(lp);
389 } else {
390 super.setTitleGravity(gravity);
391 }
392 }
393
Michael Kolb66706532010-12-12 19:50:22 -0800394 // action mode callbacks
395
396 @Override
397 public void onActionModeStarted(ActionMode mode) {
Michael Kolb7cdc4902011-02-03 17:54:40 -0800398 if (!mTitleBar.isEditingUrl()) {
Michael Kolb66706532010-12-12 19:50:22 -0800399 // hide the fake title bar when CAB is shown
Michael Kolb7cdc4902011-02-03 17:54:40 -0800400 hideTitleBar();
Michael Kolb66706532010-12-12 19:50:22 -0800401 }
402 }
403
404 @Override
Michael Kolb376b5412010-12-15 11:52:57 -0800405 public void onActionModeFinished(boolean inLoad) {
406 checkTabCount();
407 if (inLoad) {
408 // the titlebar was removed when the CAB was shown
409 // if the page is loading, show it again
Michael Kolb7cdc4902011-02-03 17:54:40 -0800410 mTitleBar.setShowProgressOnly(true);
411 if (!isTitleBarShowing()) {
412 setTitleGravity(Gravity.TOP);
Michael Kolb376b5412010-12-15 11:52:57 -0800413 }
Michael Kolb7cdc4902011-02-03 17:54:40 -0800414 showTitleBar();
Michael Kolb376b5412010-12-15 11:52:57 -0800415 }
416 }
417
418 @Override
Michael Kolb5a72f182011-01-13 20:35:06 -0800419 protected void updateNavigationState(Tab tab) {
420 mTitleBar.updateNavigationState(tab);
Michael Kolb5a72f182011-01-13 20:35:06 -0800421 }
422
423 @Override
John Reck30c714c2010-12-16 17:30:34 -0800424 public void setUrlTitle(Tab tab) {
425 super.setUrlTitle(tab);
426 mTabBar.onUrlAndTitle(tab, tab.getUrl(), tab.getTitle());
Michael Kolb66706532010-12-12 19:50:22 -0800427 }
428
429 // Set the favicon in the title bar.
430 @Override
John Reck30c714c2010-12-16 17:30:34 -0800431 public void setFavicon(Tab tab) {
432 super.setFavicon(tab);
433 mTabBar.onFavicon(tab, tab.getFavicon());
Michael Kolb66706532010-12-12 19:50:22 -0800434 }
435
Michael Kolbcfa3af52010-12-14 10:36:11 -0800436 @Override
437 public void showVoiceTitleBar(String title) {
438 List<String> vsresults = null;
439 if (getActiveTab() != null) {
440 vsresults = getActiveTab().getVoiceSearchResults();
441 }
Michael Kolb3a2a1642011-02-15 10:52:07 -0800442 mTitleBar.setInVoiceMode(true, vsresults);
Michael Kolbcfa3af52010-12-14 10:36:11 -0800443 mTitleBar.setDisplayTitle(title);
Michael Kolbcfa3af52010-12-14 10:36:11 -0800444 }
445
446 @Override
447 public void revertVoiceTitleBar(Tab tab) {
448 mTitleBar.setInVoiceMode(false, null);
John Reck30c714c2010-12-16 17:30:34 -0800449 String url = tab.getUrl();
Michael Kolbcfa3af52010-12-14 10:36:11 -0800450 mTitleBar.setDisplayTitle(url);
Michael Kolbcfa3af52010-12-14 10:36:11 -0800451 }
452
John Reckd73c5a22010-12-22 10:22:50 -0800453 @Override
454 public void showCustomView(View view, CustomViewCallback callback) {
455 super.showCustomView(view, callback);
456 mActivity.getActionBar().hide();
457 }
Michael Kolbcfa3af52010-12-14 10:36:11 -0800458
John Reckd73c5a22010-12-22 10:22:50 -0800459 @Override
460 public void onHideCustomView() {
461 super.onHideCustomView();
462 if (mUseQuickControls) {
463 checkTabCount();
464 } else {
465 mActivity.getActionBar().show();
466 }
467 }
Michael Kolba4183062011-01-16 10:43:21 -0800468
469 @Override
470 public boolean dispatchKey(int code, KeyEvent event) {
471 WebView web = getActiveTab().getWebView();
Michael Kolbdc2ee1b2011-02-14 14:34:40 -0800472 if (event.getAction() == KeyEvent.ACTION_DOWN) {
473
474 switch (code) {
475 case KeyEvent.KEYCODE_TAB:
476 case KeyEvent.KEYCODE_DPAD_UP:
477 case KeyEvent.KEYCODE_DPAD_LEFT:
478 if ((web != null) && web.hasFocus() && !mTitleBar.hasFocus()) {
479 editUrl(false);
480 return true;
481 }
482 }
483 boolean ctrl = event.hasModifiers(KeyEvent.META_CTRL_ON);
484 if (!ctrl && isTypingKey(event) && !mTitleBar.isEditingUrl()) {
485 editUrl(true);
486 return mContentView.dispatchKeyEvent(event);
487 }
Michael Kolba4183062011-01-16 10:43:21 -0800488 }
489 return false;
490 }
491
Michael Kolbdc2ee1b2011-02-14 14:34:40 -0800492 private boolean isTypingKey(KeyEvent evt) {
493 return evt.getUnicodeChar() > 0;
494 }
495
496 TabBar getTabBar() {
497 return mTabBar;
498 }
499
Narayan Kamath5119edd2011-02-23 15:49:17 +0000500 @Override
501 public void registerDropdownChangeListener(DropdownChangeListener d) {
502 mTitleBar.registerDropdownChangeListener(d);
503 }
Michael Kolb66706532010-12-12 19:50:22 -0800504}