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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
610 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 610 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
611 IDR_DEFAULT_FAVICON); | 611 IDR_DEFAULT_FAVICON); |
612 } | 612 } |
613 | 613 |
614 // static | 614 // static |
615 bool GtkThemeService::DefaultUsesSystemTheme() { | 615 bool GtkThemeService::DefaultUsesSystemTheme() { |
616 scoped_ptr<base::Environment> env(base::Environment::Create()); | 616 scoped_ptr<base::Environment> env(base::Environment::Create()); |
617 | 617 |
618 switch (base::nix::GetDesktopEnvironment(env.get())) { | 618 switch (base::nix::GetDesktopEnvironment(env.get())) { |
619 case base::nix::DESKTOP_ENVIRONMENT_GNOME: | 619 case base::nix::DESKTOP_ENVIRONMENT_GNOME: |
620 case base::nix::DESKTOP_ENVIRONMENT_UNITY: | |
620 case base::nix::DESKTOP_ENVIRONMENT_XFCE: | 621 case base::nix::DESKTOP_ENVIRONMENT_XFCE: |
621 return true; | 622 return true; |
622 default: | 623 case base::nix::DESKTOP_ENVIRONMENT_KDE3: |
624 case base::nix::DESKTOP_ENVIRONMENT_KDE4: | |
625 case base::nix::DESKTOP_ENVIRONMENT_OTHER: | |
623 return false; | 626 return false; |
624 } | 627 } |
628 // g++ can't figure out the switch statement has all cases covered. | |
Mike Mammarella
2012/07/12 01:15:55
Technically, it can, it's just not sure that someb
Lei Zhang
2012/07/12 02:27:02
Sure, I changed the comment.
| |
629 NOTREACHED(); | |
630 return false; | |
625 } | 631 } |
626 | 632 |
627 void GtkThemeService::ClearAllThemeData() { | 633 void GtkThemeService::ClearAllThemeData() { |
628 colors_.clear(); | 634 colors_.clear(); |
629 tints_.clear(); | 635 tints_.clear(); |
630 | 636 |
631 ThemeService::ClearAllThemeData(); | 637 ThemeService::ClearAllThemeData(); |
632 } | 638 } |
633 | 639 |
634 void GtkThemeService::LoadThemePrefs() { | 640 void GtkThemeService::LoadThemePrefs() { |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1146 cairo_new_path(cr); | 1152 cairo_new_path(cr); |
1147 cairo_set_line_width(cr, 1.0); | 1153 cairo_set_line_width(cr, 1.0); |
1148 cairo_move_to(cr, start_x, allocation.y); | 1154 cairo_move_to(cr, start_x, allocation.y); |
1149 cairo_line_to(cr, start_x, allocation.y + allocation.height); | 1155 cairo_line_to(cr, start_x, allocation.y + allocation.height); |
1150 cairo_stroke(cr); | 1156 cairo_stroke(cr); |
1151 cairo_destroy(cr); | 1157 cairo_destroy(cr); |
1152 cairo_pattern_destroy(pattern); | 1158 cairo_pattern_destroy(pattern); |
1153 | 1159 |
1154 return TRUE; | 1160 return TRUE; |
1155 } | 1161 } |
OLD | NEW |