Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Side by Side Diff: chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc

Issue 7737001: content: Start splitting up chrome/browser/ui/gtk/gtk_util.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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"
36 #include "ui/base/l10n/l10n_util.h" 37 #include "ui/base/l10n/l10n_util.h"
37 #include "ui/base/resource/resource_bundle.h" 38 #include "ui/base/resource/resource_bundle.h"
38 #include "ui/gfx/color_utils.h" 39 #include "ui/gfx/color_utils.h"
39 #include "ui/gfx/font.h" 40 #include "ui/gfx/font.h"
40 #include "ui/gfx/gtk_util.h" 41 #include "ui/gfx/gtk_util.h"
41 #include "ui/gfx/skia_utils_gtk.h" 42 #include "ui/gfx/skia_utils_gtk.h"
42 43
43 #if defined(TOOLKIT_VIEWS) 44 #if defined(TOOLKIT_VIEWS)
44 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view. h" 45 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view. h"
45 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 46 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 const GdkColor* background_color_ptr; 962 const GdkColor* background_color_ptr;
962 #if defined(TOOLKIT_VIEWS) 963 #if defined(TOOLKIT_VIEWS)
963 const GdkColor background_color = gfx::SkColorToGdkColor( 964 const GdkColor background_color = gfx::SkColorToGdkColor(
964 LocationBarView::GetColor(ToolbarModel::NONE, 965 LocationBarView::GetColor(ToolbarModel::NONE,
965 LocationBarView::BACKGROUND)); 966 LocationBarView::BACKGROUND));
966 background_color_ptr = &background_color; 967 background_color_ptr = &background_color;
967 #else 968 #else
968 background_color_ptr = &LocationBarViewGtk::kBackgroundColor; 969 background_color_ptr = &LocationBarViewGtk::kBackgroundColor;
969 #endif 970 #endif
970 gtk_widget_modify_cursor( 971 gtk_widget_modify_cursor(
971 text_view_, &gtk_util::kGdkBlack, &gtk_util::kGdkGray); 972 text_view_, &ui::kGdkBlack, &ui::kGdkGray);
972 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, background_color_ptr); 973 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, background_color_ptr);
973 974
974 #if !defined(TOOLKIT_VIEWS) 975 #if !defined(TOOLKIT_VIEWS)
975 GdkColor c; 976 GdkColor c;
976 // Override the selected colors so we don't leak colors from the current 977 // Override the selected colors so we don't leak colors from the current
977 // gtk theme into the chrome-theme. 978 // gtk theme into the chrome-theme.
978 c = gfx::SkColorToGdkColor( 979 c = gfx::SkColorToGdkColor(
979 theme_service_->get_active_selection_bg_color()); 980 theme_service_->get_active_selection_bg_color());
980 gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, &c); 981 gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, &c);
981 982
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 // baseline, so we need to move the |instant_view_| down to make sure it 2330 // baseline, so we need to move the |instant_view_| down to make sure it
2330 // has the same baseline as the |text_view_|. 2331 // has the same baseline as the |text_view_|.
2331 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); 2332 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_));
2332 int height; 2333 int height;
2333 pango_layout_get_size(layout, NULL, &height); 2334 pango_layout_get_size(layout, NULL, &height);
2334 PangoLayoutIter* iter = pango_layout_get_iter(layout); 2335 PangoLayoutIter* iter = pango_layout_get_iter(layout);
2335 int baseline = pango_layout_iter_get_baseline(iter); 2336 int baseline = pango_layout_iter_get_baseline(iter);
2336 pango_layout_iter_free(iter); 2337 pango_layout_iter_free(iter);
2337 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); 2338 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL);
2338 } 2339 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc ('k') | chrome/browser/ui/gtk/page_info_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698