diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 21:08:41 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 21:08:41 +0000 |
commit | 1c83eb444727c703709f7deea88e51f8da2e504e (patch) | |
tree | 4c7153390bc1fafd217eff84d113f5ff1ae102f2 /chrome/common | |
parent | 303bdcbbda3d59a6fb2c475a98a1ce4793ab1817 (diff) | |
download | chromium_src-1c83eb444727c703709f7deea88e51f8da2e504e.zip chromium_src-1c83eb444727c703709f7deea88e51f8da2e504e.tar.gz chromium_src-1c83eb444727c703709f7deea88e51f8da2e504e.tar.bz2 |
Linux focus ring color: Go through WebKit::WebColor api rather than through the webview.
Also use SkColor isntead of a triplet of colors in RenderPreferences.
BUG=21521
Review URL: http://codereview.chromium.org/195059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/gtk_util.cc | 21 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 20 | ||||
-rw-r--r-- | chrome/common/renderer_preferences.h | 10 |
3 files changed, 26 insertions, 25 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index e026877..605e1a8 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -16,6 +16,7 @@ #include "chrome/common/renderer_preferences.h" #include "grit/theme_resources.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/skia/include/core/SkColor.h" namespace { @@ -405,9 +406,8 @@ void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs) { // base[SELECTED] seems more appropriate but in practice it is often too light // to be easily visible. GdkColor color = style->bg[GTK_STATE_SELECTED]; - prefs->focus_ring_color_r = color.red / 257; - prefs->focus_ring_color_g = color.green / 257; - prefs->focus_ring_color_b = color.blue / 257; + prefs->focus_ring_color = + SkColorSetRGB(color.red / 257, color.green / 257, color.blue / 257); if (hint_style) g_free(hint_style); @@ -474,4 +474,19 @@ GdkColor AverageColors(GdkColor color_one, GdkColor color_two) { return average_color; } +void SetAlwaysShowImage(GtkWidget* image_menu_item) { +#if GTK_CHECK_VERSION(2, 16, 1) + gtk_image_menu_item_set_always_show_image( + GTK_IMAGE_MENU_ITEM(image_menu_item), TRUE); +#else + if (gtk_check_version(2, 16, 1)) { + GValue true_value = { 0 }; + g_value_init(&true_value, G_TYPE_BOOLEAN); + g_value_set_boolean(&true_value, TRUE); + g_object_set_property(G_OBJECT(image_menu_item), "always-show-image", + &true_value); + } +#endif +} + } // namespace gtk_util diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 22b9b45..752c208 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -1577,9 +1577,7 @@ struct ParamTraits<RendererPreferences> { WriteParam(m, p.should_antialias_text); WriteParam(m, static_cast<int>(p.hinting)); WriteParam(m, static_cast<int>(p.subpixel_rendering)); - WriteParam(m, p.focus_ring_color_r); - WriteParam(m, p.focus_ring_color_g); - WriteParam(m, p.focus_ring_color_b); + WriteParam(m, p.focus_ring_color); WriteParam(m, p.browser_handles_top_level_requests); } static bool Read(const Message* m, void** iter, param_type* p) { @@ -1600,20 +1598,10 @@ struct ParamTraits<RendererPreferences> { static_cast<RendererPreferencesSubpixelRenderingEnum>( subpixel_rendering); - int focus_ring_color_r; - if (!ReadParam(m, iter, &focus_ring_color_r)) + int focus_ring_color; + if (!ReadParam(m, iter, &focus_ring_color)) return false; - p->focus_ring_color_r = focus_ring_color_r; - - int focus_ring_color_g; - if (!ReadParam(m, iter, &focus_ring_color_g)) - return false; - p->focus_ring_color_g = focus_ring_color_g; - - int focus_ring_color_b; - if (!ReadParam(m, iter, &focus_ring_color_b)) - return false; - p->focus_ring_color_b = focus_ring_color_b; + p->focus_ring_color = focus_ring_color; if (!ReadParam(m, iter, &p->browser_handles_top_level_requests)) return false; diff --git a/chrome/common/renderer_preferences.h b/chrome/common/renderer_preferences.h index fcdc273..b08548e 100644 --- a/chrome/common/renderer_preferences.h +++ b/chrome/common/renderer_preferences.h @@ -12,6 +12,8 @@ #ifndef CHROME_COMMON_RENDERER_PREFERENCES_H_ #define CHROME_COMMON_RENDERER_PREFERENCES_H_ +#include "third_party/skia/include/core/SkColor.h" + enum RendererPreferencesHintingEnum { RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT = 0, RENDERER_PREFERENCES_HINTING_NONE, @@ -47,9 +49,7 @@ struct RendererPreferences { RendererPreferencesSubpixelRenderingEnum subpixel_rendering; // The color of the focus ring. Currently only used on Linux. - int focus_ring_color_r; - int focus_ring_color_g; - int focus_ring_color_b; + SkColor focus_ring_color; // Browser wants a look at all top level requests bool browser_handles_top_level_requests; @@ -60,9 +60,7 @@ struct RendererPreferences { hinting(RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT), subpixel_rendering( RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT), - focus_ring_color_r(0), - focus_ring_color_g(0), - focus_ring_color_b(0), + focus_ring_color(0), browser_handles_top_level_requests(false) { } }; |