summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 20:11:39 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 20:11:39 +0000
commitefba8d707b56c019f6d1d13a22285d0a39850fa4 (patch)
tree217f2161c2b9d3674d445500f4171f9d4ffe6ccd /chrome/browser/tab_contents
parent5cd4d0d559ea23eb56604bae8de670e2c663c1f7 (diff)
downloadchromium_src-efba8d707b56c019f6d1d13a22285d0a39850fa4.zip
chromium_src-efba8d707b56c019f6d1d13a22285d0a39850fa4.tar.gz
chromium_src-efba8d707b56c019f6d1d13a22285d0a39850fa4.tar.bz2
linux: theme scrollbars from GTK theme
Pick the color of the slider's thumbpart and rail from the GTK theme. We cannot match the exact visual appearance of the GTK theme, as rendering engines can make arbitrary changes to the actual visual appearance. But by sampling a representative set of pixels, we ensure that we will at least match the general color scheme. BUG=10949 patch by <markus [at] chromium> original review: http://codereview.chromium.org/400027/show Review URL: http://codereview.chromium.org/466080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc4
-rw-r--r--chrome/browser/tab_contents/interstitial_page.h2
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc6
-rw-r--r--chrome/browser/tab_contents/tab_contents.h2
4 files changed, 9 insertions, 5 deletions
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc
index aae90da..1af79b6 100644
--- a/chrome/browser/tab_contents/interstitial_page.cc
+++ b/chrome/browser/tab_contents/interstitial_page.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/common/bindings_policy.h"
#if defined(TOOLKIT_GTK)
+#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/common/gtk_util.h"
#endif
#include "chrome/common/notification_service.h"
@@ -143,7 +144,8 @@ InterstitialPage::InterstitialPage(TabContents* tab,
DCHECK(new_navigation || !tab->controller().pending_entry());
#if defined(TOOLKIT_GTK)
- gtk_util::InitRendererPrefsFromGtkSettings(&renderer_preferences_);
+ gtk_util::InitRendererPrefsFromGtkSettings(&renderer_preferences_,
+ GtkThemeProvider::GetFrom(tab->profile())->UseGtkTheme());
#endif
}
diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h
index aff6a74..0312131 100644
--- a/chrome/browser/tab_contents/interstitial_page.h
+++ b/chrome/browser/tab_contents/interstitial_page.h
@@ -107,7 +107,7 @@ class InterstitialPage : public NotificationObserver,
const std::wstring& title);
virtual void DomOperationResponse(const std::string& json_string,
int automation_id);
- virtual RendererPreferences GetRendererPrefs() const {
+ virtual RendererPreferences GetRendererPrefs(Profile* profile) const {
return renderer_preferences_;
}
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 964bff1..30b393d 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -45,6 +45,7 @@
#include "chrome/browser/renderer_host/resource_request_details.h"
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
+#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/tab_contents/interstitial_page.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
@@ -259,7 +260,8 @@ TabContents::TabContents(Profile* profile,
last_javascript_message_dismissal_(),
suppress_javascript_messages_(false),
is_showing_before_unload_dialog_(false),
- renderer_preferences_(platform_util::GetInitedRendererPreferences()),
+ renderer_preferences_(
+ renderer_preferences_util::GetInitedRendererPreferences(profile)),
opener_dom_ui_type_(DOMUIFactory::kNoDOMUI) {
#if defined(OS_CHROMEOS)
// Make sure the thumbnailer is started before starting the render manager.
@@ -1882,7 +1884,7 @@ RenderViewHostDelegate::AutoFill* TabContents::GetAutoFillDelegate() {
return autofill_manager_.get();
}
-RendererPreferences TabContents::GetRendererPrefs() const {
+RendererPreferences TabContents::GetRendererPrefs(Profile* profile) const {
return renderer_preferences_;
}
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 072e430..18f0d44 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -903,7 +903,7 @@ class TabContents : public PageNavigator,
virtual void PageHasOSDD(RenderViewHost* render_view_host,
int32 page_id, const GURL& url, bool autodetected);
virtual GURL GetAlternateErrorPageURL() const;
- virtual RendererPreferences GetRendererPrefs() const;
+ virtual RendererPreferences GetRendererPrefs(Profile* profile) const;
virtual WebPreferences GetWebkitPrefs();
virtual void OnJSOutOfMemory();
virtual void OnCrossSiteResponse(int new_render_process_host_id,