summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc5
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.h4
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc4
-rw-r--r--chrome/browser/cocoa/location_bar/location_bar_view_mac.h6
-rw-r--r--chrome/browser/cocoa/location_bar/location_bar_view_mac.mm16
-rw-r--r--chrome/browser/gtk/location_bar_view_gtk.h7
6 files changed, 30 insertions, 12 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index 49b687b..dd6b14c 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -403,9 +403,8 @@ void AutocompleteEditModel::OpenURL(const GURL& url,
// search engine, if applicable; see comments in template_url.h.
}
-#if defined(TOOLKIT_VIEWS)
controller_->OnAutocompleteWillAccept();
-#endif
+
if (disposition != NEW_BACKGROUND_TAB)
view_->RevertAll(); // Revert the box to its unedited state
controller_->OnAutocompleteAccept(url, disposition, transition,
@@ -677,9 +676,7 @@ bool AutocompleteEditModel::OnAfterPossibleChange(const std::wstring& new_text,
}
void AutocompleteEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) {
-#if defined(TOOLKIT_VIEWS)
controller_->OnPopupBoundsChanged(bounds);
-#endif
}
// Return true if the suggestion type warrants a TCP/IP preconnection.
diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h
index 33420dd..a9cdf1a 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.h
+++ b/chrome/browser/autocomplete/autocomplete_edit.h
@@ -33,7 +33,6 @@ class Rect;
// Embedders of an AutocompleteEdit widget must implement this class.
class AutocompleteEditController {
public:
-#if defined(TOOLKIT_VIEWS)
// Sent when the autocomplete popup is about to close.
virtual void OnAutocompleteWillClosePopup() = 0;
@@ -51,9 +50,6 @@ class AutocompleteEditController {
// Invoked when the popup is going to change its bounds to |bounds|.
virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) = 0;
-#else
- // TODO: port.
-#endif
// When the user presses enter or selects a line with the mouse, this
// function will get called synchronously with the url to open and
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 0991524..ee94a96 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -513,10 +513,8 @@ void AutocompleteEditViewGtk::UpdatePopup() {
}
void AutocompleteEditViewGtk::ClosePopup() {
-#if defined(TOOLKIT_VIEWS)
if (popup_view_->GetModel()->IsOpen())
controller_->OnAutocompleteWillClosePopup();
-#endif
popup_view_->GetModel()->StopAutocomplete();
}
@@ -948,11 +946,9 @@ gboolean AutocompleteEditViewGtk::HandleViewFocusIn(GtkWidget* sender,
gboolean AutocompleteEditViewGtk::HandleViewFocusOut(GtkWidget* sender,
GdkEventFocus* event) {
-#if defined(TOOLKIT_VIEWS)
// This must be invoked before ClosePopup.
// TODO: figure out who is getting focus.
controller_->OnAutocompleteLosingFocus(NULL);
-#endif
// Close the popup.
ClosePopup();
diff --git a/chrome/browser/cocoa/location_bar/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar/location_bar_view_mac.h
index 7ff8306..911fdc6 100644
--- a/chrome/browser/cocoa/location_bar/location_bar_view_mac.h
+++ b/chrome/browser/cocoa/location_bar/location_bar_view_mac.h
@@ -125,6 +125,12 @@ class LocationBarViewMac : public AutocompleteEditController,
// visible.
NSRect GetBlockedPopupRect() const;
+ // AutocompleteEditController implementation.
+ virtual void OnAutocompleteWillClosePopup();
+ virtual void OnAutocompleteLosingFocus(gfx::NativeView unused);
+ virtual void OnAutocompleteWillAccept();
+ virtual bool OnCommitSuggestedText(const std::wstring& typed_text);
+ virtual void OnPopupBoundsChanged(const gfx::Rect& bounds);
virtual void OnAutocompleteAccept(const GURL& url,
WindowOpenDisposition disposition,
PageTransition::Type transition,
diff --git a/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm
index 8863841..15841d2 100644
--- a/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm
@@ -200,6 +200,22 @@ void LocationBarViewMac::Update(const TabContents* contents,
OnChanged();
}
+void LocationBarViewMac::OnAutocompleteWillClosePopup() {
+}
+
+void LocationBarViewMac::OnAutocompleteLosingFocus(gfx::NativeView unused) {
+}
+
+void LocationBarViewMac::OnAutocompleteWillAccept() {
+}
+
+bool LocationBarViewMac::OnCommitSuggestedText(const std::wstring& typed_text) {
+ return false;
+}
+
+void LocationBarViewMac::OnPopupBoundsChanged(const gfx::Rect& bounds) {
+}
+
void LocationBarViewMac::OnAutocompleteAccept(const GURL& url,
WindowOpenDisposition disposition,
PageTransition::Type transition,
diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h
index 6ad62d1..a0a3484 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.h
+++ b/chrome/browser/gtk/location_bar_view_gtk.h
@@ -88,6 +88,13 @@ class LocationBarViewGtk : public AutocompleteEditController,
void SetStarred(bool starred);
// Implement the AutocompleteEditController interface.
+ virtual void OnAutocompleteWillClosePopup() {}
+ virtual void OnAutocompleteLosingFocus(gfx::NativeView view_gaining_focus) {}
+ virtual void OnAutocompleteWillAccept() {}
+ virtual bool OnCommitSuggestedText(const std::wstring& typed_text) {
+ return false;
+ }
+ virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) {}
virtual void OnAutocompleteAccept(const GURL& url,
WindowOpenDisposition disposition,
PageTransition::Type transition,