OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
(...skipping 14 matching lines...) Expand all Loading... |
26 #include "chrome/browser/gtk/view_id_util.h" | 26 #include "chrome/browser/gtk/view_id_util.h" |
27 #include "chrome/browser/tab_contents/tab_contents.h" | 27 #include "chrome/browser/tab_contents/tab_contents.h" |
28 #include "chrome/browser/toolbar_model.h" | 28 #include "chrome/browser/toolbar_model.h" |
29 #include "chrome/common/gtk_util.h" | 29 #include "chrome/common/gtk_util.h" |
30 #include "chrome/common/notification_service.h" | 30 #include "chrome/common/notification_service.h" |
31 #include "googleurl/src/gurl.h" | 31 #include "googleurl/src/gurl.h" |
32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
33 #include "net/base/escape.h" | 33 #include "net/base/escape.h" |
34 | 34 |
35 #if defined(TOOLKIT_VIEWS) | 35 #if defined(TOOLKIT_VIEWS) |
| 36 #include "app/gfx/skia_utils_gtk.h" |
36 #include "chrome/browser/views/location_bar_view.h" | 37 #include "chrome/browser/views/location_bar_view.h" |
37 #include "skia/ext/skia_utils_gtk.h" | |
38 #else | 38 #else |
39 #include "chrome/browser/gtk/gtk_theme_provider.h" | 39 #include "chrome/browser/gtk/gtk_theme_provider.h" |
40 #include "chrome/browser/gtk/location_bar_view_gtk.h" | 40 #include "chrome/browser/gtk/location_bar_view_gtk.h" |
41 #endif | 41 #endif |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 const char kTextBaseColor[] = "#808080"; | 45 const char kTextBaseColor[] = "#808080"; |
46 const char kSecureSchemeColor[] = "#009614"; | 46 const char kSecureSchemeColor[] = "#009614"; |
47 const char kInsecureSchemeColor[] = "#c80000"; | 47 const char kInsecureSchemeColor[] = "#c80000"; |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 // between text[] and base[] manually instead of just using text_aa[]. | 588 // between text[] and base[] manually instead of just using text_aa[]. |
589 GdkColor average_color = gtk_util::AverageColors( | 589 GdkColor average_color = gtk_util::AverageColors( |
590 style->text[GTK_STATE_NORMAL], style->base[GTK_STATE_NORMAL]); | 590 style->text[GTK_STATE_NORMAL], style->base[GTK_STATE_NORMAL]); |
591 | 591 |
592 g_object_set(faded_text_tag_, "foreground-gdk", | 592 g_object_set(faded_text_tag_, "foreground-gdk", |
593 &average_color, NULL); | 593 &average_color, NULL); |
594 g_object_set(normal_text_tag_, "foreground-gdk", | 594 g_object_set(normal_text_tag_, "foreground-gdk", |
595 &style->text[GTK_STATE_NORMAL], NULL); | 595 &style->text[GTK_STATE_NORMAL], NULL); |
596 } else { | 596 } else { |
597 #if defined(TOOLKIT_VIEWS) | 597 #if defined(TOOLKIT_VIEWS) |
598 const GdkColor background_color = skia::SkColorToGdkColor( | 598 const GdkColor background_color = gfx::SkColorToGdkColor( |
599 LocationBarView::GetColor(is_secure, LocationBarView::BACKGROUND)); | 599 LocationBarView::GetColor(is_secure, LocationBarView::BACKGROUND)); |
600 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, | 600 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, |
601 &background_color); | 601 &background_color); |
602 #else | 602 #else |
603 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, | 603 gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, |
604 &LocationBarViewGtk::kBackgroundColorByLevel[scheme_security_level_]); | 604 &LocationBarViewGtk::kBackgroundColorByLevel[scheme_security_level_]); |
605 #endif | 605 #endif |
606 | 606 |
607 g_object_set(faded_text_tag_, "foreground", kTextBaseColor, NULL); | 607 g_object_set(faded_text_tag_, "foreground", kTextBaseColor, NULL); |
608 g_object_set(normal_text_tag_, "foreground", "#000000", NULL); | 608 g_object_set(normal_text_tag_, "foreground", "#000000", NULL); |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 | 1414 |
1415 PangoDirection dir = PANGO_DIRECTION_NEUTRAL; | 1415 PangoDirection dir = PANGO_DIRECTION_NEUTRAL; |
1416 do { | 1416 do { |
1417 dir = pango_unichar_direction(gtk_text_iter_get_char(&iter)); | 1417 dir = pango_unichar_direction(gtk_text_iter_get_char(&iter)); |
1418 if (dir != PANGO_DIRECTION_NEUTRAL) | 1418 if (dir != PANGO_DIRECTION_NEUTRAL) |
1419 break; | 1419 break; |
1420 } while (gtk_text_iter_forward_char(&iter)); | 1420 } while (gtk_text_iter_forward_char(&iter)); |
1421 | 1421 |
1422 return dir; | 1422 return dir; |
1423 } | 1423 } |
OLD | NEW |