| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/gtk/gtk_theme_service.h" | 5 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 return ThemeService::GetColor(id); | 329 return ThemeService::GetColor(id); |
| 330 } | 330 } |
| 331 | 331 |
| 332 bool GtkThemeService::HasCustomImage(int id) const { | 332 bool GtkThemeService::HasCustomImage(int id) const { |
| 333 if (use_gtk_) | 333 if (use_gtk_) |
| 334 return IsOverridableImage(id); | 334 return IsOverridableImage(id); |
| 335 | 335 |
| 336 return ThemeService::HasCustomImage(id); | 336 return ThemeService::HasCustomImage(id); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void GtkThemeService::InitThemesFor(content::NotificationObserver* observer) { | 339 void GtkThemeService::InitThemesFor(NotificationObserver* observer) { |
| 340 observer->Observe(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 340 observer->Observe(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 341 content::Source<ThemeService>(this), | 341 content::Source<ThemeService>(this), |
| 342 content::NotificationService::NoDetails()); | 342 content::NotificationService::NoDetails()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void GtkThemeService::SetTheme(const extensions::Extension* extension) { | 345 void GtkThemeService::SetTheme(const extensions::Extension* extension) { |
| 346 profile()->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, false); | 346 profile()->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, false); |
| 347 LoadDefaultValues(); | 347 LoadDefaultValues(); |
| 348 ThemeService::SetTheme(extension); | 348 ThemeService::SetTheme(extension); |
| 349 } | 349 } |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 cairo_stroke(cr); | 1143 cairo_stroke(cr); |
| 1144 cairo_destroy(cr); | 1144 cairo_destroy(cr); |
| 1145 cairo_pattern_destroy(pattern); | 1145 cairo_pattern_destroy(pattern); |
| 1146 | 1146 |
| 1147 return TRUE; | 1147 return TRUE; |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 void GtkThemeService::OnUsesSystemThemeChanged() { | 1150 void GtkThemeService::OnUsesSystemThemeChanged() { |
| 1151 use_gtk_ = profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme); | 1151 use_gtk_ = profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme); |
| 1152 } | 1152 } |
| OLD | NEW |