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 "autofill_popup_view_gtk.h" | 5 #include "autofill_popup_view_gtk.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autofill/autofill_external_delegate.h" | 9 #include "chrome/browser/autofill/autofill_external_delegate.h" |
10 #include "chrome/browser/ui/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 ui::StackPopupWindow(window_, toplevel); | 110 ui::StackPopupWindow(window_, toplevel); |
111 } | 111 } |
112 | 112 |
113 void AutofillPopupViewGtk::HideInternal() { | 113 void AutofillPopupViewGtk::HideInternal() { |
114 gtk_widget_hide(window_); | 114 gtk_widget_hide(window_); |
115 } | 115 } |
116 | 116 |
117 void AutofillPopupViewGtk::InvalidateRow(size_t row) { | 117 void AutofillPopupViewGtk::InvalidateRow(size_t row) { |
118 GdkRectangle row_rect = GetRectForRow( | 118 GdkRectangle row_rect = GetRectForRow( |
119 row, bounds_.width(), row_height_).ToGdkRectangle(); | 119 row, bounds_.width(), row_height_).ToGdkRectangle(); |
120 gdk_window_invalidate_rect(window_->window, &row_rect, FALSE); | 120 GdkWindow* gdk_window = gtk_widget_get_window(window_); |
| 121 gdk_window_invalidate_rect(gdk_window, &row_rect, FALSE); |
121 } | 122 } |
122 | 123 |
123 gboolean AutofillPopupViewGtk::HandleButtonRelease(GtkWidget* widget, | 124 gboolean AutofillPopupViewGtk::HandleButtonRelease(GtkWidget* widget, |
124 GdkEventButton* event) { | 125 GdkEventButton* event) { |
125 // We only care about the left click. | 126 // We only care about the left click. |
126 if (event->button != 1) | 127 if (event->button != 1) |
127 return FALSE; | 128 return FALSE; |
128 | 129 |
129 size_t line = LineFromY(event->y); | 130 size_t line = LineFromY(event->y); |
130 DCHECK_LT(line, autofill_values().size()); | 131 DCHECK_LT(line, autofill_values().size()); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 pango_attr_list_insert(attrs, fg_attr); // Ownership taken. | 238 pango_attr_list_insert(attrs, fg_attr); // Ownership taken. |
238 | 239 |
239 | 240 |
240 pango_layout_set_attributes(layout_, attrs); // Ref taken. | 241 pango_layout_set_attributes(layout_, attrs); // Ref taken. |
241 pango_attr_list_unref(attrs); | 242 pango_attr_list_unref(attrs); |
242 } | 243 } |
243 | 244 |
244 int AutofillPopupViewGtk::LineFromY(int y) { | 245 int AutofillPopupViewGtk::LineFromY(int y) { |
245 return y / row_height_; | 246 return y / row_height_; |
246 } | 247 } |
OLD | NEW |