OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/autofill/autofill_external_delegate.h" | 11 #include "chrome/browser/autofill/autofill_external_delegate.h" |
12 #include "ui/base/gtk/gtk_signal.h" | 12 #include "ui/base/gtk/gtk_signal.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 | 14 |
15 class AutofillPopupViewGtk; | 15 class AutofillPopupViewGtk; |
16 | 16 |
17 class AutofillExternalDelegateGtk : public AutofillExternalDelegate { | 17 class AutofillExternalDelegateGtk : public AutofillExternalDelegate { |
18 public: | 18 public: |
19 AutofillExternalDelegateGtk(TabContents* tab_contents, | 19 AutofillExternalDelegateGtk(TabContents* tab_contents, |
20 AutofillManager* autofill_manager); | 20 AutofillManager* autofill_manager); |
21 | 21 |
22 virtual ~AutofillExternalDelegateGtk(); | 22 virtual ~AutofillExternalDelegateGtk(); |
23 | 23 |
24 protected: | 24 protected: |
25 // AutofillExternalDelegate implementations. | 25 // AutofillExternalDelegate implementations. |
26 virtual void HideAutofillPopupInternal() OVERRIDE; | 26 virtual void HideAutofillPopupInternal() OVERRIDE; |
27 virtual void OnQueryPlatformSpecific( | 27 virtual void OnQueryPlatformSpecific( |
28 int query_id, | 28 int query_id, |
29 const webkit::forms::FormData& form, | 29 const FormData& form, |
30 const webkit::forms::FormField& field, | 30 const FormFieldData& field, |
31 const gfx::Rect& bounds) OVERRIDE; | 31 const gfx::Rect& bounds) OVERRIDE; |
32 virtual void ApplyAutofillSuggestions( | 32 virtual void ApplyAutofillSuggestions( |
33 const std::vector<string16>& autofill_values, | 33 const std::vector<string16>& autofill_values, |
34 const std::vector<string16>& autofill_labels, | 34 const std::vector<string16>& autofill_labels, |
35 const std::vector<string16>& autofill_icons, | 35 const std::vector<string16>& autofill_icons, |
36 const std::vector<int>& autofill_unique_ids) OVERRIDE; | 36 const std::vector<int>& autofill_unique_ids) OVERRIDE; |
37 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 37 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
38 | 38 |
39 private: | 39 private: |
40 // Create a valid view to display the autofill results if one doesn't | 40 // Create a valid view to display the autofill results if one doesn't |
41 // currently exist. | 41 // currently exist. |
42 void CreateViewIfNeeded(); | 42 void CreateViewIfNeeded(); |
43 | 43 |
44 CHROMEGTK_CALLBACK_1(AutofillExternalDelegateGtk, gboolean, | 44 CHROMEGTK_CALLBACK_1(AutofillExternalDelegateGtk, gboolean, |
45 HandleViewFocusOut, GdkEventFocus*); | 45 HandleViewFocusOut, GdkEventFocus*); |
46 | 46 |
47 scoped_ptr<AutofillPopupViewGtk> view_; | 47 scoped_ptr<AutofillPopupViewGtk> view_; |
48 | 48 |
49 gfx::NativeView tab_native_view_; // Weak reference. | 49 gfx::NativeView tab_native_view_; // Weak reference. |
50 | 50 |
51 // The handler value for the focus out event, allows us to block and unblock | 51 // The handler value for the focus out event, allows us to block and unblock |
52 // it as needed. | 52 // it as needed. |
53 gulong event_handler_id_; | 53 gulong event_handler_id_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegateGtk); | 55 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegateGtk); |
56 }; | 56 }; |
57 | 57 |
58 #endif // CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_GTK_H_ | 58 #endif // CHROME_BROWSER_UI_GTK_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_GTK_H_ |
OLD | NEW |