diff options
author | John Reck <jreck@google.com> | 2011-07-12 16:42:08 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-07-13 10:26:27 -0700 |
commit | ef654f1dd80f55609060005342fc4f2cde62990c (patch) | |
tree | 99bac9d568efd8972a703e26b2a35c6fb047d882 /src/com/android/browser/Controller.java | |
parent | 9ef259af433edc5aeb11b5d5d94dc9acc697c61e (diff) | |
download | packages_apps_browser-ef654f1dd80f55609060005342fc4f2cde62990c.zip packages_apps_browser-ef654f1dd80f55609060005342fc4f2cde62990c.tar.gz packages_apps_browser-ef654f1dd80f55609060005342fc4f2cde62990c.tar.bz2 |
Snapshot title bar
Bug: 4982126
Change-Id: I67931d39e3a3ce535b38197ebeee1651241d1a60
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r-- | src/com/android/browser/Controller.java | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index bba49c2..5b00179 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -536,7 +536,7 @@ public class Controller } - + @Override public Tab getCurrentTab() { return mTabControl.getCurrentTab(); } @@ -1463,14 +1463,14 @@ public class Controller menu.setGroupEnabled(R.id.MAIN_MENU, true); menu.setGroupEnabled(R.id.MAIN_SHORTCUT_MENU, true); } - final WebView w = getCurrentTopWebView(); + final Tab t = getCurrentTab(); boolean canGoBack = false; boolean canGoForward = false; boolean isHome = false; - if (w != null) { - canGoBack = w.canGoBack(); - canGoForward = w.canGoForward(); - isHome = mSettings.getHomePage().equals(w.getUrl()); + if (t != null) { + canGoBack = t.canGoBack(); + canGoForward = t.canGoForward(); + isHome = mSettings.getHomePage().equals(t.getUrl()); } final MenuItem back = menu.findItem(R.id.back_menu_id); back.setEnabled(canGoBack); @@ -1563,11 +1563,11 @@ public class Controller break; case R.id.back_menu_id: - getCurrentTopWebView().goBack(); + getCurrentTab().goBack(); break; case R.id.forward_menu_id: - getCurrentTopWebView().goForward(); + getCurrentTab().goForward(); break; case R.id.close_menu_id: @@ -2373,12 +2373,11 @@ public class Controller @Override public void onUserCanceledSsl(Tab tab) { - WebView web = tab.getWebView(); // TODO: Figure out the "right" behavior - if (web.canGoBack()) { - web.goBack(); + if (tab.canGoBack()) { + tab.goBack(); } else { - web.loadUrl(mSettings.getHomePage()); + tab.loadUrl(mSettings.getHomePage(), null); } } @@ -2395,9 +2394,8 @@ public class Controller mActivity.moveTaskToBack(true); return; } - WebView w = current.getWebView(); - if (w.canGoBack()) { - w.goBack(); + if (current.canGoBack()) { + current.goBack(); } else { // Check to see if we are closing a window that was created by // another window. If so, we switch back to that window. @@ -2506,7 +2504,8 @@ public class Controller } WebView webView = getCurrentTopWebView(); - if (webView == null) return false; + Tab tab = getCurrentTab(); + if (webView == null || tab == null) return false; boolean ctrl = event.hasModifiers(KeyEvent.META_CTRL_ON); boolean shift = event.hasModifiers(KeyEvent.META_SHIFT_ON); @@ -2540,13 +2539,13 @@ public class Controller return true; case KeyEvent.KEYCODE_DPAD_LEFT: if (ctrl) { - webView.goBack(); + tab.goBack(); return true; } break; case KeyEvent.KEYCODE_DPAD_RIGHT: if (ctrl) { - webView.goForward(); + tab.goForward(); return true; } break; |