Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: chrome/browser/ui/gtk/gtk_theme_service.cc

Issue 6766004: Create a ProfileDependencyManager to order ProfileKeyedService destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix improper usage of static_cast<> in existing mac code. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/gtk/gtk_theme_service.h ('k') | chrome/browser/ui/gtk/reload_button_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 bool GtkThemeService::HasCustomImage(int id) const { 321 bool GtkThemeService::HasCustomImage(int id) const {
322 if (use_gtk_) 322 if (use_gtk_)
323 return IsOverridableImage(id); 323 return IsOverridableImage(id);
324 324
325 return ThemeService::HasCustomImage(id); 325 return ThemeService::HasCustomImage(id);
326 } 326 }
327 327
328 void GtkThemeService::InitThemesFor(NotificationObserver* observer) { 328 void GtkThemeService::InitThemesFor(NotificationObserver* observer) {
329 observer->Observe(NotificationType::BROWSER_THEME_CHANGED, 329 observer->Observe(NotificationType::BROWSER_THEME_CHANGED,
330 Source<ui::ThemeProvider>(this), 330 Source<ThemeService>(this),
331 NotificationService::NoDetails()); 331 NotificationService::NoDetails());
332 } 332 }
333 333
334 void GtkThemeService::SetTheme(const Extension* extension) { 334 void GtkThemeService::SetTheme(const Extension* extension) {
335 profile()->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, false); 335 profile()->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, false);
336 LoadDefaultValues(); 336 LoadDefaultValues();
337 ThemeService::SetTheme(extension); 337 ThemeService::SetTheme(extension);
338 } 338 }
339 339
340 void GtkThemeService::UseDefaultTheme() { 340 void GtkThemeService::UseDefaultTheme() {
(...skipping 10 matching lines...) Expand all
351 } 351 }
352 352
353 bool GtkThemeService::UsingDefaultTheme() { 353 bool GtkThemeService::UsingDefaultTheme() {
354 return !use_gtk_ && ThemeService::UsingDefaultTheme(); 354 return !use_gtk_ && ThemeService::UsingDefaultTheme();
355 } 355 }
356 356
357 void GtkThemeService::Observe(NotificationType type, 357 void GtkThemeService::Observe(NotificationType type,
358 const NotificationSource& source, 358 const NotificationSource& source,
359 const NotificationDetails& details) { 359 const NotificationDetails& details) {
360 if ((type == NotificationType::PREF_CHANGED) && 360 if ((type == NotificationType::PREF_CHANGED) &&
361 (*Details<std::string>(details).ptr() == prefs::kUsesSystemTheme)) 361 (*Details<std::string>(details).ptr() == prefs::kUsesSystemTheme)) {
362 use_gtk_ = profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme); 362 use_gtk_ = profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme);
363 } else {
364 ThemeService::Observe(type, source, details);
365 }
363 } 366 }
364 367
365 GtkWidget* GtkThemeService::BuildChromeButton() { 368 GtkWidget* GtkThemeService::BuildChromeButton() {
366 GtkWidget* button = HoverControllerGtk::CreateChromeButton(); 369 GtkWidget* button = HoverControllerGtk::CreateChromeButton();
367 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(button), use_gtk_); 370 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(button), use_gtk_);
368 chrome_buttons_.push_back(button); 371 chrome_buttons_.push_back(button);
369 372
370 signals_->Connect(button, "destroy", G_CALLBACK(OnDestroyChromeButtonThunk), 373 signals_->Connect(button, "destroy", G_CALLBACK(OnDestroyChromeButtonThunk),
371 this); 374 this);
372 return button; 375 return button;
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 cairo_set_line_width(cr, 1.0); 1132 cairo_set_line_width(cr, 1.0);
1130 cairo_move_to(cr, start_x, widget->allocation.y); 1133 cairo_move_to(cr, start_x, widget->allocation.y);
1131 cairo_line_to(cr, start_x, 1134 cairo_line_to(cr, start_x,
1132 widget->allocation.y + widget->allocation.height); 1135 widget->allocation.y + widget->allocation.height);
1133 cairo_stroke(cr); 1136 cairo_stroke(cr);
1134 cairo_destroy(cr); 1137 cairo_destroy(cr);
1135 cairo_pattern_destroy(pattern); 1138 cairo_pattern_destroy(pattern);
1136 1139
1137 return TRUE; 1140 return TRUE;
1138 } 1141 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_theme_service.h ('k') | chrome/browser/ui/gtk/reload_button_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698