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/ui/gtk/omnibox/omnibox_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/omnibox/omnibox_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> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
16 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 16 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
17 #include "chrome/browser/autocomplete/autocomplete_match.h" | 17 #include "chrome/browser/autocomplete/autocomplete_match.h" |
18 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 18 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
19 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 19 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
20 #include "chrome/browser/command_updater.h" | 20 #include "chrome/browser/command_updater.h" |
21 #include "chrome/browser/defaults.h" | 21 #include "chrome/browser/defaults.h" |
22 #include "chrome/browser/instant/instant_controller.h" | 22 #include "chrome/browser/instant/instant_controller.h" |
23 #include "chrome/browser/platform_util.h" | 23 #include "chrome/browser/platform_util.h" |
24 #include "chrome/browser/ui/gtk/gtk_util.h" | 24 #include "chrome/browser/ui/gtk/gtk_util.h" |
25 #include "chrome/browser/ui/gtk/view_id_util.h" | 25 #include "chrome/browser/ui/gtk/view_id_util.h" |
26 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 26 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
27 #include "chrome/common/chrome_notification_types.h" | 27 #include "chrome/common/chrome_notification_types.h" |
28 #include "content/browser/tab_contents/tab_contents.h" | 28 #include "content/browser/tab_contents/tab_contents.h" |
29 #include "content/common/notification_service.h" | 29 #include "content/public/browser/notification_source.h" |
30 #include "googleurl/src/gurl.h" | 30 #include "googleurl/src/gurl.h" |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "net/base/escape.h" | 32 #include "net/base/escape.h" |
33 #include "third_party/undoview/undo_view.h" | 33 #include "third_party/undoview/undo_view.h" |
34 #include "ui/base/animation/multi_animation.h" | 34 #include "ui/base/animation/multi_animation.h" |
35 #include "ui/base/dragdrop/drag_drop_types.h" | 35 #include "ui/base/dragdrop/drag_drop_types.h" |
36 #include "ui/base/gtk/gtk_hig_constants.h" | 36 #include "ui/base/gtk/gtk_hig_constants.h" |
37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
38 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
39 #include "ui/gfx/color_utils.h" | 39 #include "ui/gfx/color_utils.h" |
(...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 // baseline, so we need to move the |instant_view_| down to make sure it | 2352 // baseline, so we need to move the |instant_view_| down to make sure it |
2353 // has the same baseline as the |text_view_|. | 2353 // has the same baseline as the |text_view_|. |
2354 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); | 2354 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); |
2355 int height; | 2355 int height; |
2356 pango_layout_get_size(layout, NULL, &height); | 2356 pango_layout_get_size(layout, NULL, &height); |
2357 PangoLayoutIter* iter = pango_layout_get_iter(layout); | 2357 PangoLayoutIter* iter = pango_layout_get_iter(layout); |
2358 int baseline = pango_layout_iter_get_baseline(iter); | 2358 int baseline = pango_layout_iter_get_baseline(iter); |
2359 pango_layout_iter_free(iter); | 2359 pango_layout_iter_free(iter); |
2360 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); | 2360 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); |
2361 } | 2361 } |
OLD | NEW |