summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.h3
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view.h4
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc5
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.h1
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.h1
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.mm4
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.cc13
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.h1
8 files changed, 19 insertions, 13 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h
index 6a8c6d6..7b29b7f 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.h
+++ b/chrome/browser/autocomplete/autocomplete_edit.h
@@ -47,9 +47,6 @@ class AutocompleteEditController {
// the edit is guaranteed to be showing the permanent text.
virtual void OnInputInProgress(bool in_progress) = 0;
- // Called whenever the autocomplete edit gets focused.
- virtual void OnSetFocus() = 0;
-
// Returns the favicon of the current page.
virtual SkBitmap GetFavIcon() const = 0;
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view.h b/chrome/browser/autocomplete/autocomplete_edit_view.h
index cba7342..cdca4c8 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view.h
@@ -128,6 +128,10 @@ class AutocompleteEditView {
// Returns the gfx::NativeView of the edit view.
virtual gfx::NativeView GetNativeView() const = 0;
+
+ // Returns the gfx::NativeView of the edit view that should receive focus when
+ // the location bar is focused.
+ virtual gfx::NativeView GetFocusNativeView() const = 0;
};
#endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_H_
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 6dfb45d..2798fc2 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -505,6 +505,10 @@ gfx::NativeView AutocompleteEditViewGtk::GetNativeView() const {
return alignment_.get();
}
+gfx::NativeView AutocompleteEditViewGtk::GetFocusNativeView() const {
+ return text_view_;
+}
+
void AutocompleteEditViewGtk::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
@@ -756,7 +760,6 @@ gboolean AutocompleteEditViewGtk::HandleViewFocusIn() {
GdkModifierType modifiers;
gdk_window_get_pointer(text_view_->window, NULL, NULL, &modifiers);
model_->OnSetFocus((modifiers & GDK_CONTROL_MASK) != 0);
- controller_->OnSetFocus();
// TODO(deanm): Some keyword hit business, etc here.
return FALSE; // Continue propagation.
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
index 3f5c87a..b9c9280 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
@@ -110,6 +110,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView,
virtual void OnBeforePossibleChange();
virtual bool OnAfterPossibleChange();
virtual gfx::NativeView GetNativeView() const;
+ virtual gfx::NativeView GetFocusNativeView() const;
// Overridden from NotificationObserver:
virtual void Observe(NotificationType type,
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
index 56d7cee..b293d8b 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
@@ -89,6 +89,7 @@ class AutocompleteEditViewMac : public AutocompleteEditView,
virtual void OnBeforePossibleChange();
virtual bool OnAfterPossibleChange();
virtual gfx::NativeView GetNativeView() const;
+ virtual gfx::NativeView GetFocusNativeView() const;
// Implement the AutocompleteTextFieldObserver interface.
virtual void OnControlKeyChanged(bool pressed);
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index e81d0fe..56fb434 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -550,6 +550,10 @@ gfx::NativeView AutocompleteEditViewMac::GetNativeView() const {
return field_;
}
+gfx::NativeView AutocompleteEditViewMac::GetFocusNativeView() const {
+ return field_;
+}
+
void AutocompleteEditViewMac::OnUpOrDownKeyPressed(bool up, bool by_page) {
// We should only arrive here when the field is focussed.
DCHECK(IsFirstResponder());
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index 91ea6b1..5af7976 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -870,6 +870,10 @@ gfx::NativeView AutocompleteEditViewWin::GetNativeView() const {
return m_hWnd;
}
+gfx::NativeView AutocompleteEditViewWin::GetFocusNativeView() const {
+ return m_hWnd;
+}
+
void AutocompleteEditViewWin::PasteAndGo(const std::wstring& text) {
if (CanPasteAndGo(text))
model_->PasteAndGo();
@@ -1636,15 +1640,6 @@ void AutocompleteEditViewWin::OnPaste() {
}
void AutocompleteEditViewWin::OnSetFocus(HWND focus_wnd) {
- views::FocusManager* focus_manager = parent_view_->GetFocusManager();
- if (focus_manager) {
- // Notify the FocusManager that the focused view is now the location bar
- // (our parent view).
- focus_manager->SetFocusedView(parent_view_);
- } else {
- NOTREACHED();
- }
-
model_->OnSetFocus(GetKeyState(VK_CONTROL) < 0);
// Notify controller if it needs to show hint UI of some kind.
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.h b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
index 8946c4c..a4cf616 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
@@ -120,6 +120,7 @@ class AutocompleteEditViewWin
virtual void OnBeforePossibleChange();
virtual bool OnAfterPossibleChange();
virtual gfx::NativeView GetNativeView() const;
+ virtual gfx::NativeView GetFocusNativeView() const;
// Exposes custom IAccessible implementation to the overall MSAA hierarchy.
IAccessible* GetIAccessible();