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 <set> |
| 10 |
9 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 12 #include "base/env_var.h" |
10 #include "base/linux_util.h" | 13 #include "base/linux_util.h" |
11 #include "base/stl_util-inl.h" | 14 #include "base/stl_util-inl.h" |
12 #include "chrome/browser/metrics/user_metrics.h" | 15 #include "chrome/browser/metrics/user_metrics.h" |
13 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
14 #include "chrome/browser/gtk/cairo_cached_surface.h" | 17 #include "chrome/browser/gtk/cairo_cached_surface.h" |
15 #include "chrome/browser/gtk/hover_controller_gtk.h" | 18 #include "chrome/browser/gtk/hover_controller_gtk.h" |
16 #include "chrome/browser/gtk/gtk_chrome_button.h" | 19 #include "chrome/browser/gtk/gtk_chrome_button.h" |
17 #include "chrome/browser/gtk/meta_frames.h" | 20 #include "chrome/browser/gtk/meta_frames.h" |
18 #include "chrome/browser/pref_service.h" | 21 #include "chrome/browser/pref_service.h" |
19 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 GTK_ICON_SIZE_MENU, NULL); | 396 GTK_ICON_SIZE_MENU, NULL); |
394 } | 397 } |
395 if (default_bookmark_icon_) | 398 if (default_bookmark_icon_) |
396 return default_bookmark_icon_; | 399 return default_bookmark_icon_; |
397 } | 400 } |
398 | 401 |
399 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 402 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
400 static GdkPixbuf* default_bookmark_icon_ = rb.GetPixbufNamed( | 403 static GdkPixbuf* default_bookmark_icon_ = rb.GetPixbufNamed( |
401 IDR_DEFAULT_FAVICON); | 404 IDR_DEFAULT_FAVICON); |
402 return default_bookmark_icon_; | 405 return default_bookmark_icon_; |
403 | |
404 } | 406 } |
405 | 407 |
406 // static | 408 // static |
407 bool GtkThemeProvider::DefaultUsesSystemTheme() { | 409 bool GtkThemeProvider::DefaultUsesSystemTheme() { |
408 scoped_ptr<base::EnvironmentVariableGetter> env_getter( | 410 scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create()); |
409 base::EnvironmentVariableGetter::Create()); | |
410 | 411 |
411 switch (base::GetDesktopEnvironment(env_getter.get())) { | 412 switch (base::GetDesktopEnvironment(env_getter.get())) { |
412 case base::DESKTOP_ENVIRONMENT_GNOME: | 413 case base::DESKTOP_ENVIRONMENT_GNOME: |
413 case base::DESKTOP_ENVIRONMENT_XFCE: | 414 case base::DESKTOP_ENVIRONMENT_XFCE: |
414 return true; | 415 return true; |
415 default: | 416 default: |
416 return false; | 417 return false; |
417 } | 418 } |
418 } | 419 } |
419 | 420 |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 cairo_set_line_width(cr, 1.0); | 811 cairo_set_line_width(cr, 1.0); |
811 cairo_move_to(cr, start_x, widget->allocation.y); | 812 cairo_move_to(cr, start_x, widget->allocation.y); |
812 cairo_line_to(cr, start_x, | 813 cairo_line_to(cr, start_x, |
813 widget->allocation.y + widget->allocation.height); | 814 widget->allocation.y + widget->allocation.height); |
814 cairo_stroke(cr); | 815 cairo_stroke(cr); |
815 cairo_destroy(cr); | 816 cairo_destroy(cr); |
816 cairo_pattern_destroy(pattern); | 817 cairo_pattern_destroy(pattern); |
817 | 818 |
818 return TRUE; | 819 return TRUE; |
819 } | 820 } |
OLD | NEW |