| 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> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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/common/notification_service.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" | |
| 37 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
| 38 #include "ui/base/resource/resource_bundle.h" | 37 #include "ui/base/resource/resource_bundle.h" |
| 39 #include "ui/gfx/color_utils.h" | 38 #include "ui/gfx/color_utils.h" |
| 40 #include "ui/gfx/font.h" | 39 #include "ui/gfx/font.h" |
| 41 #include "ui/gfx/gtk_util.h" | 40 #include "ui/gfx/gtk_util.h" |
| 42 #include "ui/gfx/skia_utils_gtk.h" | 41 #include "ui/gfx/skia_utils_gtk.h" |
| 43 | 42 |
| 44 #if defined(TOOLKIT_VIEWS) | 43 #if defined(TOOLKIT_VIEWS) |
| 45 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" | 44 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" |
| 46 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 45 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 const GdkColor* background_color_ptr; | 961 const GdkColor* background_color_ptr; |
| 963 #if defined(TOOLKIT_VIEWS) | 962 #if defined(TOOLKIT_VIEWS) |
| 964 const GdkColor background_color = gfx::SkColorToGdkColor( | 963 const GdkColor background_color = gfx::SkColorToGdkColor( |
| 965 LocationBarView::GetColor(ToolbarModel::NONE, | 964 LocationBarView::GetColor(ToolbarModel::NONE, |
| 966 LocationBarView::BACKGROUND)); | 965 LocationBarView::BACKGROUND)); |
| 967 background_color_ptr = &background_color; | 966 background_color_ptr = &background_color; |
| 968 #else | 967 #else |
| 969 background_color_ptr = &LocationBarViewGtk::kBackgroundColor; | 968 background_color_ptr = &LocationBarViewGtk::kBackgroundColor; |
| 970 #endif | 969 #endif |
| 971 gtk_widget_modify_cursor( | 970 gtk_widget_modify_cursor( |
| 972 text_view_, &ui::kGdkBlack, &ui::kGdkGray); | 971 text_view_, >k_util::kGdkBlack, >k_util::kGdkGray); |
| 973 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, background_color_ptr); | 972 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, background_color_ptr); |
| 974 | 973 |
| 975 #if !defined(TOOLKIT_VIEWS) | 974 #if !defined(TOOLKIT_VIEWS) |
| 976 GdkColor c; | 975 GdkColor c; |
| 977 // Override the selected colors so we don't leak colors from the current | 976 // Override the selected colors so we don't leak colors from the current |
| 978 // gtk theme into the chrome-theme. | 977 // gtk theme into the chrome-theme. |
| 979 c = gfx::SkColorToGdkColor( | 978 c = gfx::SkColorToGdkColor( |
| 980 theme_service_->get_active_selection_bg_color()); | 979 theme_service_->get_active_selection_bg_color()); |
| 981 gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, &c); | 980 gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, &c); |
| 982 | 981 |
| (...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2330 // baseline, so we need to move the |instant_view_| down to make sure it | 2329 // baseline, so we need to move the |instant_view_| down to make sure it |
| 2331 // has the same baseline as the |text_view_|. | 2330 // has the same baseline as the |text_view_|. |
| 2332 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); | 2331 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); |
| 2333 int height; | 2332 int height; |
| 2334 pango_layout_get_size(layout, NULL, &height); | 2333 pango_layout_get_size(layout, NULL, &height); |
| 2335 PangoLayoutIter* iter = pango_layout_get_iter(layout); | 2334 PangoLayoutIter* iter = pango_layout_get_iter(layout); |
| 2336 int baseline = pango_layout_iter_get_baseline(iter); | 2335 int baseline = pango_layout_iter_get_baseline(iter); |
| 2337 pango_layout_iter_free(iter); | 2336 pango_layout_iter_free(iter); |
| 2338 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); | 2337 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); |
| 2339 } | 2338 } |
| OLD | NEW |