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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 608 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
609 IDR_DEFAULT_FAVICON); | 609 IDR_DEFAULT_FAVICON); |
610 } | 610 } |
611 | 611 |
612 // static | 612 // static |
613 bool GtkThemeService::DefaultUsesSystemTheme() { | 613 bool GtkThemeService::DefaultUsesSystemTheme() { |
614 scoped_ptr<base::Environment> env(base::Environment::Create()); | 614 scoped_ptr<base::Environment> env(base::Environment::Create()); |
615 | 615 |
616 switch (base::nix::GetDesktopEnvironment(env.get())) { | 616 switch (base::nix::GetDesktopEnvironment(env.get())) { |
617 case base::nix::DESKTOP_ENVIRONMENT_GNOME: | 617 case base::nix::DESKTOP_ENVIRONMENT_GNOME: |
| 618 case base::nix::DESKTOP_ENVIRONMENT_UNITY: |
618 case base::nix::DESKTOP_ENVIRONMENT_XFCE: | 619 case base::nix::DESKTOP_ENVIRONMENT_XFCE: |
619 return true; | 620 return true; |
620 default: | 621 case base::nix::DESKTOP_ENVIRONMENT_KDE3: |
| 622 case base::nix::DESKTOP_ENVIRONMENT_KDE4: |
| 623 case base::nix::DESKTOP_ENVIRONMENT_OTHER: |
621 return false; | 624 return false; |
622 } | 625 } |
| 626 // Unless GetDesktopEnvironment() badly misbehaves, this should never happen. |
| 627 NOTREACHED(); |
| 628 return false; |
623 } | 629 } |
624 | 630 |
625 void GtkThemeService::ClearAllThemeData() { | 631 void GtkThemeService::ClearAllThemeData() { |
626 colors_.clear(); | 632 colors_.clear(); |
627 tints_.clear(); | 633 tints_.clear(); |
628 | 634 |
629 ThemeService::ClearAllThemeData(); | 635 ThemeService::ClearAllThemeData(); |
630 } | 636 } |
631 | 637 |
632 void GtkThemeService::LoadThemePrefs() { | 638 void GtkThemeService::LoadThemePrefs() { |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 cairo_new_path(cr); | 1150 cairo_new_path(cr); |
1145 cairo_set_line_width(cr, 1.0); | 1151 cairo_set_line_width(cr, 1.0); |
1146 cairo_move_to(cr, start_x, allocation.y); | 1152 cairo_move_to(cr, start_x, allocation.y); |
1147 cairo_line_to(cr, start_x, allocation.y + allocation.height); | 1153 cairo_line_to(cr, start_x, allocation.y + allocation.height); |
1148 cairo_stroke(cr); | 1154 cairo_stroke(cr); |
1149 cairo_destroy(cr); | 1155 cairo_destroy(cr); |
1150 cairo_pattern_destroy(pattern); | 1156 cairo_pattern_destroy(pattern); |
1151 | 1157 |
1152 return TRUE; | 1158 return TRUE; |
1153 } | 1159 } |
OLD | NEW |