summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/location_bar_view_mac.mm
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 21:47:01 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 21:47:01 +0000
commit394aa59248445297e01bf09acc40c2ff0fb34999 (patch)
treee9549ea2649db32eba6ddb39e277ddbd3e34b492 /chrome/browser/cocoa/location_bar_view_mac.mm
parent2afc8336851ae77cfc681c8823d1c478364a4cd3 (diff)
downloadchromium_src-394aa59248445297e01bf09acc40c2ff0fb34999.zip
chromium_src-394aa59248445297e01bf09acc40c2ff0fb34999.tar.gz
chromium_src-394aa59248445297e01bf09acc40c2ff0fb34999.tar.bz2
Use Chrome facilities for omnibox state save and restore on Mac.
TabContents has a facility for storing a bag of stuff across current-tab changes. Wire up AutocompleteEditViewMac to use that facility. Unfork some code in Browser::TabSelectedAt() so that the new code gets used, and straighten up the Mac code along the code path between there and AutocompleteEditViewMac. This overall change also exposed a couple bugs/mis-features in the AutocompleteEditViewMac code. TEST=Text field maintains contents and selection across tab changes, even when edited. Review URL: http://codereview.chromium.org/114017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/location_bar_view_mac.mm')
-rw-r--r--chrome/browser/cocoa/location_bar_view_mac.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar_view_mac.mm
index b8c521f..138a567 100644
--- a/chrome/browser/cocoa/location_bar_view_mac.mm
+++ b/chrome/browser/cocoa/location_bar_view_mac.mm
@@ -56,6 +56,12 @@ void LocationBarViewMac::SaveStateToContents(TabContents* contents) {
edit_view_->SaveStateToTab(contents);
}
+void LocationBarViewMac::Update(const TabContents* contents,
+ bool should_restore_state) {
+ // AutocompleteEditView restores state if the tab is non-NULL.
+ edit_view_->Update(should_restore_state ? contents : NULL);
+}
+
void LocationBarViewMac::OnAutocompleteAccept(const GURL& url,
WindowOpenDisposition disposition,
PageTransition::Type transition,