OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/autocomplete/autocomplete_edit_view_gtk.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 | 888 |
889 autocomplete->EnableAccessibility(); | 889 autocomplete->EnableAccessibility(); |
890 | 890 |
891 return autocomplete; | 891 return autocomplete; |
892 } | 892 } |
893 #endif | 893 #endif |
894 | 894 |
895 void AutocompleteEditViewGtk::Observe(NotificationType type, | 895 void AutocompleteEditViewGtk::Observe(NotificationType type, |
896 const NotificationSource& source, | 896 const NotificationSource& source, |
897 const NotificationDetails& details) { | 897 const NotificationDetails& details) { |
898 DCHECK(type == NotificationType::BROWSER_THEME_CHANGED); | 898 DCHECK_EQ(type, NotificationType::BROWSER_THEME_CHANGED); |
899 | 899 |
900 SetBaseColor(); | 900 SetBaseColor(); |
901 } | 901 } |
902 | 902 |
903 void AutocompleteEditViewGtk::AnimationEnded(const ui::Animation* animation) { | 903 void AutocompleteEditViewGtk::AnimationEnded(const ui::Animation* animation) { |
904 controller_->OnCommitSuggestedText(false); | 904 controller_->OnCommitSuggestedText(false); |
905 } | 905 } |
906 | 906 |
907 void AutocompleteEditViewGtk::AnimationProgressed( | 907 void AutocompleteEditViewGtk::AnimationProgressed( |
908 const ui::Animation* animation) { | 908 const ui::Animation* animation) { |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 // baseline, so we need to move the |instant_view_| down to make sure it | 2291 // baseline, so we need to move the |instant_view_| down to make sure it |
2292 // has the same baseline as the |text_view_|. | 2292 // has the same baseline as the |text_view_|. |
2293 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); | 2293 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); |
2294 int height; | 2294 int height; |
2295 pango_layout_get_size(layout, NULL, &height); | 2295 pango_layout_get_size(layout, NULL, &height); |
2296 PangoLayoutIter* iter = pango_layout_get_iter(layout); | 2296 PangoLayoutIter* iter = pango_layout_get_iter(layout); |
2297 int baseline = pango_layout_iter_get_baseline(iter); | 2297 int baseline = pango_layout_iter_get_baseline(iter); |
2298 pango_layout_iter_free(iter); | 2298 pango_layout_iter_free(iter); |
2299 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); | 2299 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); |
2300 } | 2300 } |
OLD | NEW |