OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/gtk_theme_provider.h" | 5 #include "chrome/browser/gtk/gtk_theme_provider.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
11 #include "base/linux_util.h" | |
Evan Stade
2010/03/26 19:37:35
alphabet
| |
11 #include "chrome/browser/metrics/user_metrics.h" | 12 #include "chrome/browser/metrics/user_metrics.h" |
12 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
13 #include "chrome/browser/gtk/cairo_cached_surface.h" | 14 #include "chrome/browser/gtk/cairo_cached_surface.h" |
14 #include "chrome/browser/gtk/hover_controller_gtk.h" | 15 #include "chrome/browser/gtk/hover_controller_gtk.h" |
15 #include "chrome/browser/gtk/gtk_chrome_button.h" | 16 #include "chrome/browser/gtk/gtk_chrome_button.h" |
16 #include "chrome/browser/gtk/meta_frames.h" | 17 #include "chrome/browser/gtk/meta_frames.h" |
17 #include "chrome/browser/pref_service.h" | 18 #include "chrome/browser/pref_service.h" |
18 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
19 #include "chrome/common/notification_details.h" | 20 #include "chrome/common/notification_details.h" |
20 #include "chrome/common/notification_service.h" | 21 #include "chrome/common/notification_service.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 GTK_ICON_SIZE_MENU, NULL); | 393 GTK_ICON_SIZE_MENU, NULL); |
393 } | 394 } |
394 if (default_bookmark_icon_) | 395 if (default_bookmark_icon_) |
395 return default_bookmark_icon_; | 396 return default_bookmark_icon_; |
396 } | 397 } |
397 | 398 |
398 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 399 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
399 static GdkPixbuf* default_bookmark_icon_ = rb.GetPixbufNamed( | 400 static GdkPixbuf* default_bookmark_icon_ = rb.GetPixbufNamed( |
400 IDR_DEFAULT_FAVICON); | 401 IDR_DEFAULT_FAVICON); |
401 return default_bookmark_icon_; | 402 return default_bookmark_icon_; |
403 | |
404 } | |
405 | |
406 // static | |
407 bool GtkThemeProvider::DefaultUsesSystemTheme() { | |
408 scoped_ptr<base::EnvironmentVariableGetter> env_getter( | |
409 base::EnvironmentVariableGetter::Create()); | |
410 | |
411 switch (base::GetDesktopEnvironment(env_getter.get())) { | |
412 case base::DESKTOP_ENVIRONMENT_GNOME: | |
413 case base::DESKTOP_ENVIRONMENT_XFCE: | |
414 return true; | |
415 default: | |
416 return false; | |
417 } | |
402 } | 418 } |
403 | 419 |
404 void GtkThemeProvider::ClearAllThemeData() { | 420 void GtkThemeProvider::ClearAllThemeData() { |
405 colors_.clear(); | 421 colors_.clear(); |
406 tints_.clear(); | 422 tints_.clear(); |
407 | 423 |
408 BrowserThemeProvider::ClearAllThemeData(); | 424 BrowserThemeProvider::ClearAllThemeData(); |
409 } | 425 } |
410 | 426 |
411 void GtkThemeProvider::LoadThemePrefs() { | 427 void GtkThemeProvider::LoadThemePrefs() { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
794 cairo_set_line_width(cr, 1.0); | 810 cairo_set_line_width(cr, 1.0); |
795 cairo_move_to(cr, start_x, widget->allocation.y); | 811 cairo_move_to(cr, start_x, widget->allocation.y); |
796 cairo_line_to(cr, start_x, | 812 cairo_line_to(cr, start_x, |
797 widget->allocation.y + widget->allocation.height); | 813 widget->allocation.y + widget->allocation.height); |
798 cairo_stroke(cr); | 814 cairo_stroke(cr); |
799 cairo_destroy(cr); | 815 cairo_destroy(cr); |
800 cairo_pattern_destroy(pattern); | 816 cairo_pattern_destroy(pattern); |
801 | 817 |
802 return TRUE; | 818 return TRUE; |
803 } | 819 } |
OLD | NEW |