diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-09 20:26:43 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-09 20:26:43 +0000 |
commit | b5ac37f3cc4b85b8f7cee0b7ba61640b4a7673b5 (patch) | |
tree | 8e2a9f96f9671cb92b9362f0954df0b44595c533 /chrome/common | |
parent | 37a649305d53e4be8862da1d84797d44655acd51 (diff) | |
download | chromium_src-b5ac37f3cc4b85b8f7cee0b7ba61640b4a7673b5.zip chromium_src-b5ac37f3cc4b85b8f7cee0b7ba61640b4a7673b5.tar.gz chromium_src-b5ac37f3cc4b85b8f7cee0b7ba61640b4a7673b5.tar.bz2 |
rollback r34183
tbr=asargent
Review URL: http://codereview.chromium.org/482002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34187 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/gtk_util.cc | 22 | ||||
-rw-r--r-- | chrome/common/gtk_util.h | 3 | ||||
-rw-r--r-- | chrome/common/platform_util.h | 3 | ||||
-rw-r--r-- | chrome/common/platform_util_linux.cc | 12 | ||||
-rw-r--r-- | chrome/common/platform_util_mac.mm | 4 | ||||
-rw-r--r-- | chrome/common/platform_util_win.cc | 4 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 12 | ||||
-rw-r--r-- | chrome/common/renderer_preferences.h | 9 |
8 files changed, 24 insertions, 45 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index 5c9f870..c6c08e4 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -13,7 +13,6 @@ #include "app/resource_bundle.h" #include "base/linux_util.h" #include "base/logging.h" -#include "chrome/browser/gtk/gtk_theme_provider.h" #include "chrome/common/renderer_preferences.h" #include "grit/theme_resources.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -419,8 +418,7 @@ GtkWidget* IndentWidget(GtkWidget* content) { return content_alignment; } -void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs, - bool use_gtk_theme) { +void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs) { DCHECK(prefs); gint antialias = 0; @@ -477,24 +475,6 @@ void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs, prefs->focus_ring_color = SkColorSetRGB(color.red / 257, color.green / 257, color.blue / 257); - GdkColor thumb_active_color, thumb_inactive_color, track_color; - GtkThemeProvider::GetScrollbarColors(&thumb_active_color, - &thumb_inactive_color, - &track_color, - use_gtk_theme); - prefs->thumb_active_color = - SkColorSetRGB(thumb_active_color.red / 257, - thumb_active_color.green / 257, - thumb_active_color.blue / 257); - prefs->thumb_inactive_color = - SkColorSetRGB(thumb_inactive_color.red / 257, - thumb_inactive_color.green / 257, - thumb_inactive_color.blue / 257); - prefs->track_color = - SkColorSetRGB(track_color.red / 257, - track_color.green / 257, - track_color.blue / 257); - if (hint_style) g_free(hint_style); if (rgba_style) diff --git a/chrome/common/gtk_util.h b/chrome/common/gtk_util.h index 087ed72..7c10ce3 100644 --- a/chrome/common/gtk_util.h +++ b/chrome/common/gtk_util.h @@ -158,8 +158,7 @@ GtkWidget* IndentWidget(GtkWidget* content); // Initialize the font settings in |prefs| (used when creating new renderers) // based on GtkSettings (which itself comes from XSETTINGS). -void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs, - bool use_gtk_theme); +void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs); // Get the current location of the mouse cursor relative to the screen. gfx::Point ScreenPoint(GtkWidget* widget); diff --git a/chrome/common/platform_util.h b/chrome/common/platform_util.h index 0a042f2..fbe1ba6 100644 --- a/chrome/common/platform_util.h +++ b/chrome/common/platform_util.h @@ -7,6 +7,7 @@ #include "app/gfx/native_widget_types.h" #include "base/string16.h" +#include "chrome/common/renderer_preferences.h" class FilePath; class GURL; @@ -44,6 +45,8 @@ void SimpleErrorBox(gfx::NativeWindow parent, const string16& title, const string16& message); +RendererPreferences GetInitedRendererPreferences(); + } #endif // CHROME_COMMON_PLATFORM_UTIL_H_ diff --git a/chrome/common/platform_util_linux.cc b/chrome/common/platform_util_linux.cc index b7853c5..021d6a1 100644 --- a/chrome/common/platform_util_linux.cc +++ b/chrome/common/platform_util_linux.cc @@ -8,8 +8,8 @@ #include "base/file_util.h" #include "base/process_util.h" +#include "base/singleton.h" #include "base/string_util.h" -#include "chrome/browser/gtk/gtk_theme_provider.h" #include "chrome/common/gtk_util.h" #include "chrome/common/process_watcher.h" #include "googleurl/src/gurl.h" @@ -88,4 +88,14 @@ void SimpleErrorBox(gfx::NativeWindow parent, gtk_widget_show_all(dialog); } +RendererPreferences GetInitedRendererPreferences() { + RendererPreferences* prefs = Singleton<RendererPreferences>::get(); + static bool inited = false; + if (!inited) { + gtk_util::InitRendererPrefsFromGtkSettings(prefs); + inited = true; + } + return *prefs; +} + } // namespace platform_util diff --git a/chrome/common/platform_util_mac.mm b/chrome/common/platform_util_mac.mm index 2c9883a..db474a2 100644 --- a/chrome/common/platform_util_mac.mm +++ b/chrome/common/platform_util_mac.mm @@ -84,4 +84,8 @@ void SimpleErrorBox(gfx::NativeWindow parent, [alert runModal]; } +RendererPreferences GetInitedRendererPreferences() { + return RendererPreferences(); +} + } // namespace platform_util diff --git a/chrome/common/platform_util_win.cc b/chrome/common/platform_util_win.cc index 1b1b666..6ddd47c 100644 --- a/chrome/common/platform_util_win.cc +++ b/chrome/common/platform_util_win.cc @@ -157,4 +157,8 @@ void SimpleErrorBox(gfx::NativeWindow parent, win_util::MessageBox(parent, message, title, MB_OK | MB_SETFOREGROUND); } +RendererPreferences GetInitedRendererPreferences() { + return RendererPreferences(); +} + } // namespace platform_util diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index fce1dfe..e91a2fe 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -1559,9 +1559,6 @@ struct ParamTraits<RendererPreferences> { WriteParam(m, static_cast<int>(p.hinting)); WriteParam(m, static_cast<int>(p.subpixel_rendering)); WriteParam(m, p.focus_ring_color); - WriteParam(m, p.thumb_active_color); - WriteParam(m, p.thumb_inactive_color); - WriteParam(m, p.track_color); WriteParam(m, p.browser_handles_top_level_requests); } static bool Read(const Message* m, void** iter, param_type* p) { @@ -1587,15 +1584,6 @@ struct ParamTraits<RendererPreferences> { return false; p->focus_ring_color = focus_ring_color; - int thumb_active_color, thumb_inactive_color, track_color; - if (!ReadParam(m, iter, &thumb_active_color) || - !ReadParam(m, iter, &thumb_inactive_color) || - !ReadParam(m, iter, &track_color)) - return false; - p->thumb_active_color = thumb_active_color; - p->thumb_inactive_color = thumb_inactive_color; - p->track_color = track_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 a982d57..b08548e 100644 --- a/chrome/common/renderer_preferences.h +++ b/chrome/common/renderer_preferences.h @@ -51,12 +51,6 @@ struct RendererPreferences { // The color of the focus ring. Currently only used on Linux. SkColor focus_ring_color; - // The color of different parts of the scrollbar. Currently only used on - // Linux. - SkColor thumb_active_color; - SkColor thumb_inactive_color; - SkColor track_color; - // Browser wants a look at all top level requests bool browser_handles_top_level_requests; @@ -67,9 +61,6 @@ struct RendererPreferences { subpixel_rendering( RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT), focus_ring_color(0), - thumb_active_color(0), - thumb_inactive_color(0), - track_color(0), browser_handles_top_level_requests(false) { } }; |