diff options
author | Leon Scroggins <scroggo@google.com> | 2009-08-07 12:03:34 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2009-08-07 16:19:06 -0400 |
commit | 64b80f3efd95d7b5192731e995ccde79c4c6c11f (patch) | |
tree | baf0b8d25359d7bbcd8db6548e02ccb9bfaa9827 /src/com/android/browser | |
parent | 5b4b8f1d53b2b71ad65d51eec377119d94611662 (diff) | |
download | packages_apps_Browser-64b80f3efd95d7b5192731e995ccde79c4c6c11f.zip packages_apps_Browser-64b80f3efd95d7b5192731e995ccde79c4c6c11f.tar.gz packages_apps_Browser-64b80f3efd95d7b5192731e995ccde79c4c6c11f.tar.bz2 |
No load home page.
Rather than load a home page, bring up the browser/new tabs
displaying the bookmarks page, with a search bar that can be
clicked to open the omnibox. Also rearrange the menu. Fix for
http://b/issue?id=2018524
Diffstat (limited to 'src/com/android/browser')
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 43 | ||||
-rw-r--r-- | src/com/android/browser/CombinedBookmarkHistoryActivity.java | 12 |
2 files changed, 35 insertions, 20 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 68ccf79..0bac3ea 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -833,7 +833,7 @@ public class BrowserActivity extends Activity if (urlData.isEmpty()) { if (mSettings.isLoginInitialized()) { - webView.loadUrl(mSettings.getHomePage()); + bookmarksOrHistoryPicker(false); } else { waitForCredentials(); } @@ -1590,20 +1590,13 @@ public class BrowserActivity extends Activity } switch (item.getItemId()) { // -- Main menu - case R.id.goto_menu_id: { - String url = getTopWindow().getUrl(); - startSearch(mSettings.getHomePage().equals(url) ? null : url, true, - createGoogleSearchSourceBundle(GOOGLE_SEARCH_SOURCE_GOTO), false); - } - break; - - case R.id.bookmarks_menu_id: + case R.id.goto_menu_id: bookmarksOrHistoryPicker(false); break; case R.id.windows_menu_id: if (mTabControl.getTabCount() == 1) { - openTabAndShow(mSettings.getHomePage(), null, false, null); + openTabAndShow(EMPTY_URL_DATA, null, false, null); } else { tabPicker(true, mTabControl.getCurrentIndex(), false); } @@ -2078,8 +2071,10 @@ public class BrowserActivity extends Activity // Load the url after the AnimatingView has captured the picture. This // prevents any bad layout or bad scale from being used during // animation. - if (!urlData.isEmpty()) { - dismissSubWindow(tab); + dismissSubWindow(tab); + if (urlData.isEmpty()) { + bookmarksOrHistoryPicker(false); + } else { urlData.loadIn(tab.getWebView()); } map.put("msg", msg); @@ -2143,7 +2138,9 @@ public class BrowserActivity extends Activity // If the tab overview is up and there are animations, just load // the url. if (mTabOverview != null && mAnimationCount > 0) { - if (!urlData.isEmpty()) { + if (urlData.isEmpty()) { + bookmarksOrHistoryPicker(false); + } else { // We should not have a msg here since onCreateWindow // checks the animation count and every other caller passes // null. @@ -2168,7 +2165,7 @@ public class BrowserActivity extends Activity sendAnimateFromOverview(tab, true, urlData, delay, msg); return tab; } - } else if (!urlData.isEmpty()) { + } else { // We should not have a msg here. assert msg == null; if (mTabOverview != null && mAnimationCount == 0) { @@ -2177,8 +2174,12 @@ public class BrowserActivity extends Activity } else { // Get rid of the subwindow if it exists dismissSubWindow(currentTab); - // Load the given url. - urlData.loadIn(currentTab.getWebView()); + if (!urlData.isEmpty()) { + // Load the given url. + urlData.loadIn(currentTab.getWebView()); + } else { + bookmarksOrHistoryPicker(false); + } } } return currentTab; @@ -2665,7 +2666,7 @@ public class BrowserActivity extends Activity // Send a message to open a new tab. mHandler.sendMessageDelayed( mHandler.obtainMessage(OPEN_TAB_AND_SHOW, - mSettings.getHomePage()), delay); + null), delay); } } @@ -4613,6 +4614,8 @@ public class BrowserActivity extends Activity sendAnimateFromOverview(newTab, false, EMPTY_URL_DATA, TAB_OVERVIEW_DELAY, null); } + } else if (intent.getBooleanExtra("open_search", false)) { + onSearchRequested(); } else { final TabControl.Tab currentTab = mTabControl.getCurrentTab(); @@ -4671,8 +4674,8 @@ public class BrowserActivity extends Activity // was clicked on. if (mTabControl.getTabCount() == 0) { current = mTabControl.createNewTab(); - sendAnimateFromOverview(current, true, new UrlData( - mSettings.getHomePage()), TAB_OVERVIEW_DELAY, null); + sendAnimateFromOverview(current, true, EMPTY_URL_DATA, + TAB_OVERVIEW_DELAY, null); } else { final int index = position > 0 ? (position - 1) : 0; current = mTabControl.getTab(index); @@ -4706,7 +4709,7 @@ public class BrowserActivity extends Activity // NEW_TAB means that the "New Tab" cell was clicked on. if (index == ImageGrid.NEW_TAB) { - openTabAndShow(mSettings.getHomePage(), null, false, null); + openTabAndShow(EMPTY_URL_DATA, null, false, null); } else { sendAnimateFromOverview(mTabControl.getTab(index), false, EMPTY_URL_DATA, 0, null); diff --git a/src/com/android/browser/CombinedBookmarkHistoryActivity.java b/src/com/android/browser/CombinedBookmarkHistoryActivity.java index 7162c88..e5af46c 100644 --- a/src/com/android/browser/CombinedBookmarkHistoryActivity.java +++ b/src/com/android/browser/CombinedBookmarkHistoryActivity.java @@ -80,6 +80,18 @@ public class CombinedBookmarkHistoryActivity extends TabActivity super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.tabs); + + TextView searchBar = (TextView) findViewById(R.id.search); + searchBar.setText(getIntent().getStringExtra("url")); + searchBar.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + Intent openSearchIntent = new Intent(); + openSearchIntent.putExtra("open_search", true); + setResult(RESULT_OK, openSearchIntent); + finish(); + } + }); + getTabHost().setOnTabChangedListener(this); Bundle extras = getIntent().getExtras(); |