summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 17:36:42 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 17:36:42 +0000
commita0ea76cbf036408912e337653500aaefd51586b9 (patch)
treeed1bf3f0a50025df8c2d4b7e083593ded4d2e01a /chrome/browser/autocomplete
parent58492209d54a3af3e40fa0a876c9d6381d943188 (diff)
downloadchromium_src-a0ea76cbf036408912e337653500aaefd51586b9.zip
chromium_src-a0ea76cbf036408912e337653500aaefd51586b9.tar.gz
chromium_src-a0ea76cbf036408912e337653500aaefd51586b9.tar.bz2
Theme system cleanup
- Removes useless dependencies on themeing from content/ - Renames BrowserThemeProvider to ThemeService, along with name variants such as GtkThemeService. BrowserThemeProvider has grown by a lot to be more than an implementation of the ui::ThemeProvider interface. This change touches everything. - Rename theme_service.{h,cc} (which defined ThemeServiceFactory) to theme_service_factory.{h,cc}. BUG=77155 TEST=compiles. Review URL: http://codereview.chromium.org/6727005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc24
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.h4
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc12
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk.h4
4 files changed, 22 insertions, 22 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 390276e..9fba5cb 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -47,7 +47,7 @@
#include "views/events/event.h"
#else
#include "chrome/browser/autocomplete/autocomplete_popup_view_gtk.h"
-#include "chrome/browser/ui/gtk/gtk_theme_provider.h"
+#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/location_bar_view_gtk.h"
#endif
@@ -186,7 +186,7 @@ AutocompleteEditViewGtk::AutocompleteEditViewGtk(
#if defined(TOOLKIT_VIEWS)
location_bar_view_(location_bar),
#else
- theme_provider_(GtkThemeProvider::GetFrom(profile)),
+ theme_service_(GtkThemeService::GetFrom(profile)),
#endif
enter_was_pressed_(false),
tab_was_pressed_(false),
@@ -411,7 +411,7 @@ void AutocompleteEditViewGtk::Init() {
registrar_.Add(this,
NotificationType::BROWSER_THEME_CHANGED,
NotificationService::AllSources());
- theme_provider_->InitThemesFor(this);
+ theme_service_->InitThemesFor(this);
#else
// Manually invoke SetBaseColor() because TOOLKIT_VIEWS doesn't observe
// themes.
@@ -943,7 +943,7 @@ void AutocompleteEditViewGtk::SetBaseColor() {
#if defined(TOOLKIT_VIEWS)
bool use_gtk = false;
#else
- bool use_gtk = theme_provider_->UseGtkTheme();
+ bool use_gtk = theme_service_->UseGtkTheme();
#endif
if (use_gtk) {
gtk_widget_modify_cursor(text_view_, NULL, NULL);
@@ -986,19 +986,19 @@ void AutocompleteEditViewGtk::SetBaseColor() {
// Override the selected colors so we don't leak colors from the current
// gtk theme into the chrome-theme.
c = gfx::SkColorToGdkColor(
- theme_provider_->get_active_selection_bg_color());
+ theme_service_->get_active_selection_bg_color());
gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, &c);
c = gfx::SkColorToGdkColor(
- theme_provider_->get_active_selection_fg_color());
+ theme_service_->get_active_selection_fg_color());
gtk_widget_modify_text(text_view_, GTK_STATE_SELECTED, &c);
c = gfx::SkColorToGdkColor(
- theme_provider_->get_inactive_selection_bg_color());
+ theme_service_->get_inactive_selection_bg_color());
gtk_widget_modify_base(text_view_, GTK_STATE_ACTIVE, &c);
c = gfx::SkColorToGdkColor(
- theme_provider_->get_inactive_selection_fg_color());
+ theme_service_->get_inactive_selection_fg_color());
gtk_widget_modify_text(text_view_, GTK_STATE_ACTIVE, &c);
#endif
@@ -1021,7 +1021,7 @@ void AutocompleteEditViewGtk::UpdateInstantViewColors() {
#if defined(TOOLKIT_VIEWS)
bool use_gtk = false;
#else
- bool use_gtk = theme_provider_->UseGtkTheme();
+ bool use_gtk = theme_service_->UseGtkTheme();
#endif
if (use_gtk) {
@@ -1048,9 +1048,9 @@ void AutocompleteEditViewGtk::UpdateInstantViewColors() {
#else
normal_bg = LocationBarViewGtk::kBackgroundColor;
selection_text =
- theme_provider_->get_active_selection_fg_color();
+ theme_service_->get_active_selection_fg_color();
selection_bg =
- theme_provider_->get_active_selection_bg_color();
+ theme_service_->get_active_selection_bg_color();
#endif
}
@@ -1777,7 +1777,7 @@ gfx::Font AutocompleteEditViewGtk::GetFont() {
#if defined(TOOLKIT_VIEWS)
bool use_gtk = false;
#else
- bool use_gtk = theme_provider_->UseGtkTheme();
+ bool use_gtk = theme_service_->UseGtkTheme();
#endif
if (use_gtk) {
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
index 60d83c3..8681b18 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
@@ -45,7 +45,7 @@ class View;
}
#if !defined(TOOLKIT_VIEWS)
-class GtkThemeProvider;
+class GtkThemeService;
#endif
class AutocompleteEditViewGtk : public AutocompleteEditView,
@@ -465,7 +465,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView,
views::View* location_bar_view_;
#else
// Supplies colors, et cetera.
- GtkThemeProvider* theme_provider_;
+ GtkThemeService* theme_service_;
NotificationRegistrar registrar_;
#endif
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
index 037d970..7d4c884 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
@@ -23,7 +23,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
-#include "chrome/browser/ui/gtk/gtk_theme_provider.h"
+#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "content/common/notification_service.h"
#include "grit/theme_resources.h"
@@ -276,7 +276,7 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk(
location_bar_(location_bar),
window_(gtk_window_new(GTK_WINDOW_POPUP)),
layout_(NULL),
- theme_provider_(GtkThemeProvider::GetFrom(profile)),
+ theme_service_(GtkThemeService::GetFrom(profile)),
font_(font.DeriveFont(kEditFontAdjust)),
ignore_mouse_drag_(false),
opened_(false) {
@@ -313,7 +313,7 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk(
registrar_.Add(this,
NotificationType::BROWSER_THEME_CHANGED,
NotificationService::AllSources());
- theme_provider_->InitThemesFor(this);
+ theme_service_->InitThemesFor(this);
// TODO(erg): There appears to be a bug somewhere in something which shows
// itself when we're in NX. Previously, we called
@@ -393,10 +393,10 @@ void AutocompletePopupViewGtk::Observe(NotificationType type,
const NotificationDetails& details) {
DCHECK(type == NotificationType::BROWSER_THEME_CHANGED);
- if (theme_provider_->UseGtkTheme()) {
+ if (theme_service_->UseGtkTheme()) {
gtk_util::UndoForceFontSize(window_);
- border_color_ = theme_provider_->GetBorderColor();
+ border_color_ = theme_service_->GetBorderColor();
gtk_util::GetTextColors(
&background_color_, &selected_background_color_,
@@ -504,7 +504,7 @@ GdkPixbuf* AutocompletePopupViewGtk::IconForMatch(
}
// TODO(estade): Do we want to flip these for RTL? (Windows doesn't).
- return theme_provider_->GetPixbufNamed(icon);
+ return theme_service_->GetPixbufNamed(icon);
}
gboolean AutocompletePopupViewGtk::HandleMotion(GtkWidget* widget,
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
index 16fbc93..6597e9c 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
@@ -22,7 +22,7 @@
class AutocompleteEditModel;
class AutocompleteEditView;
class AutocompletePopupModel;
-class GtkThemeProvider;
+class GtkThemeService;
class Profile;
class SkBitmap;
@@ -115,7 +115,7 @@ class AutocompletePopupViewGtk : public AutocompletePopupView,
// The pango layout object created from the window, cached across exposes.
PangoLayout* layout_;
- GtkThemeProvider* theme_provider_;
+ GtkThemeService* theme_service_;
NotificationRegistrar registrar_;
// Font used for suggestions after being derived from the constructor's