From fd4504be3c2de832ae20aadc92d3581ac71b2d58 Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Tue, 10 Mar 2009 16:56:27 +0000 Subject: Some cleanups and hookups to LocationBarViewGtk. - Rename FocusLocation to SetFocus (and don't make it select all). This matches the Windows style more closely. - Implement SetUserText (basically copied from Windows w/ a TODO). - Switch to the gtk_accel APIs instead of using the widget ones. - Hookup FocusSearch (and its ctrl-k accelerator). - Hookup AcceptInput (the go button now works!). - Fix lack of space before { - Rename edit_view_ to location_entry_ to match the Windows LocationBarView. - Don't plumb FocusLocationBar through BrowserWindow -> BrowserToolbar. Review URL: http://codereview.chromium.org/43025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11339 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc') diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index cae7c6e..4c21fc3 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -100,9 +100,8 @@ void AutocompleteEditViewGtk::Init() { G_CALLBACK(&HandleViewMoveCursorThunk), this); } -void AutocompleteEditViewGtk::FocusLocation() { +void AutocompleteEditViewGtk::SetFocus() { gtk_widget_grab_focus(text_view_); - SelectAll(false); } void AutocompleteEditViewGtk::SaveStateToTab(TabContents* tab) { @@ -160,7 +159,12 @@ std::wstring AutocompleteEditViewGtk::GetText() const { void AutocompleteEditViewGtk::SetUserText(const std::wstring& text, const std::wstring& display_text, bool update_popup) { - NOTIMPLEMENTED(); + model_->SetUserText(text); + // TODO(deanm): something about selection / focus change here. + SetWindowTextAndCaretPos(display_text, display_text.length()); + if (update_popup) + UpdatePopup(); + TextChanged(); } void AutocompleteEditViewGtk::SetWindowTextAndCaretPos(const std::wstring& text, -- cgit v1.1