| 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 #include "chrome/browser/autofill/autofill_external_delegate_gtk.h" | 5 #include "chrome/browser/autofill/autofill_external_delegate_gtk.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h" | 7 #include "chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h" |
| 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/browser/web_contents_view.h" | 10 #include "content/public/browser/web_contents_view.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const webkit::forms::FormField& field, | 45 const webkit::forms::FormField& field, |
| 46 const gfx::Rect& bounds) { | 46 const gfx::Rect& bounds) { |
| 47 CreateViewIfNeeded(); | 47 CreateViewIfNeeded(); |
| 48 view_->set_element_bounds(bounds); | 48 view_->set_element_bounds(bounds); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void AutofillExternalDelegateGtk::ApplyAutofillSuggestions( | 51 void AutofillExternalDelegateGtk::ApplyAutofillSuggestions( |
| 52 const std::vector<string16>& autofill_values, | 52 const std::vector<string16>& autofill_values, |
| 53 const std::vector<string16>& autofill_labels, | 53 const std::vector<string16>& autofill_labels, |
| 54 const std::vector<string16>& autofill_icons, | 54 const std::vector<string16>& autofill_icons, |
| 55 const std::vector<int>& autofill_unique_ids, | 55 const std::vector<int>& autofill_unique_ids) { |
| 56 int separator_index) { | |
| 57 view_->Show(autofill_values, | 56 view_->Show(autofill_values, |
| 58 autofill_labels, | 57 autofill_labels, |
| 59 autofill_icons, | 58 autofill_icons, |
| 60 autofill_unique_ids, | 59 autofill_unique_ids); |
| 61 separator_index); | |
| 62 } | 60 } |
| 63 | 61 |
| 64 void AutofillExternalDelegateGtk::SetBounds(const gfx::Rect& bounds) { | 62 void AutofillExternalDelegateGtk::SetBounds(const gfx::Rect& bounds) { |
| 65 CreateViewIfNeeded(); | 63 CreateViewIfNeeded(); |
| 66 view_->set_element_bounds(bounds); | 64 view_->set_element_bounds(bounds); |
| 67 } | 65 } |
| 68 | 66 |
| 69 void AutofillExternalDelegateGtk::CreateViewIfNeeded() { | 67 void AutofillExternalDelegateGtk::CreateViewIfNeeded() { |
| 70 if (view_.get()) | 68 if (view_.get()) |
| 71 return; | 69 return; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 83 this); | 81 this); |
| 84 } | 82 } |
| 85 } | 83 } |
| 86 | 84 |
| 87 gboolean AutofillExternalDelegateGtk::HandleViewFocusOut(GtkWidget* sender, | 85 gboolean AutofillExternalDelegateGtk::HandleViewFocusOut(GtkWidget* sender, |
| 88 GdkEventFocus* event) { | 86 GdkEventFocus* event) { |
| 89 HideAutofillPopup(); | 87 HideAutofillPopup(); |
| 90 | 88 |
| 91 return TRUE; | 89 return TRUE; |
| 92 } | 90 } |
| OLD | NEW |