diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-10 16:56:27 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-10 16:56:27 +0000 |
commit | fd4504be3c2de832ae20aadc92d3581ac71b2d58 (patch) | |
tree | bdc624fb6ff6a9c60f72fb0afb9dfb9d7af3f79e /chrome/browser/autocomplete | |
parent | e8fab856ad84b068d841f9eef727424c1eea7460 (diff) | |
download | chromium_src-fd4504be3c2de832ae20aadc92d3581ac71b2d58.zip chromium_src-fd4504be3c2de832ae20aadc92d3581ac71b2d58.tar.gz chromium_src-fd4504be3c2de832ae20aadc92d3581ac71b2d58.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc | 10 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_gtk.h | 2 |
2 files changed, 8 insertions, 4 deletions
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, diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h index 85d16ae..f3f1d9f 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h @@ -37,7 +37,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView { GtkWidget* widget() { return text_view_; } // Grab keyboard input focus, putting focus on the location widget. - void FocusLocation(); + void SetFocus(); // Implement the AutocompleteEditView interface. virtual AutocompleteEditModel* model() { return model_.get(); } |