| 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/libgtkui/gtk_ui.h" | 5 #include "chrome/browser/ui/libgtkui/gtk_ui.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
| 9 #include <X11/Xcursor/Xcursor.h> | 9 #include <X11/Xcursor/Xcursor.h> |
| 10 | 10 |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 colors_[ThemeProperties::COLOR_TAB_THROBBER_SPINNING] = | 873 colors_[ThemeProperties::COLOR_TAB_THROBBER_SPINNING] = |
| 874 native_theme_->GetSystemColor( | 874 native_theme_->GetSystemColor( |
| 875 ui::NativeTheme::kColorId_ThrobberSpinningColor); | 875 ui::NativeTheme::kColorId_ThrobberSpinningColor); |
| 876 colors_[ThemeProperties::COLOR_TAB_THROBBER_WAITING] = | 876 colors_[ThemeProperties::COLOR_TAB_THROBBER_WAITING] = |
| 877 native_theme_->GetSystemColor( | 877 native_theme_->GetSystemColor( |
| 878 ui::NativeTheme::kColorId_ThrobberWaitingColor); | 878 ui::NativeTheme::kColorId_ThrobberWaitingColor); |
| 879 | 879 |
| 880 #if GTK_MAJOR_VERSION > 2 | 880 #if GTK_MAJOR_VERSION > 2 |
| 881 colors_[ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR] = | 881 colors_[ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR] = |
| 882 colors_[ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR] = | 882 colors_[ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR] = |
| 883 GetBorderColor("GtkToolbar.primary-toolbar.toolbar"); | 883 GetBorderColor("GtkToolbar#toolbar.primary-toolbar"); |
| 884 #endif | 884 #endif |
| 885 } | 885 } |
| 886 | 886 |
| 887 void GtkUi::LoadCursorTheme() { | 887 void GtkUi::LoadCursorTheme() { |
| 888 GtkSettings* settings = gtk_settings_get_default(); | 888 GtkSettings* settings = gtk_settings_get_default(); |
| 889 | 889 |
| 890 gchar* theme = nullptr; | 890 gchar* theme = nullptr; |
| 891 gint size = 0; | 891 gint size = 0; |
| 892 g_object_get(settings, "gtk-cursor-theme-name", &theme, | 892 g_object_get(settings, "gtk-cursor-theme-name", &theme, |
| 893 "gtk-cursor-theme-size", &size, nullptr); | 893 "gtk-cursor-theme-size", &size, nullptr); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 918 temp_color = color_utils::HSLShift(frame_color, kDefaultTintFrameIncognito); | 918 temp_color = color_utils::HSLShift(frame_color, kDefaultTintFrameIncognito); |
| 919 GetChromeStyleColor("incognito-frame-color", &temp_color); | 919 GetChromeStyleColor("incognito-frame-color", &temp_color); |
| 920 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO] = temp_color; | 920 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO] = temp_color; |
| 921 | 921 |
| 922 temp_color = | 922 temp_color = |
| 923 color_utils::HSLShift(frame_color, kDefaultTintFrameIncognitoInactive); | 923 color_utils::HSLShift(frame_color, kDefaultTintFrameIncognitoInactive); |
| 924 GetChromeStyleColor("incognito-inactive-frame-color", &temp_color); | 924 GetChromeStyleColor("incognito-inactive-frame-color", &temp_color); |
| 925 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE] = temp_color; | 925 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE] = temp_color; |
| 926 #else | 926 #else |
| 927 // TODO(thomasanderson): Render a GtkHeaderBar directly. | 927 // TODO(thomasanderson): Render a GtkHeaderBar directly. |
| 928 SkColor color_frame = GetBgColor(".headerbar.header-bar.titlebar"); | 928 SkColor color_frame = GetBgColor("#headerbar.header-bar.titlebar"); |
| 929 SkColor color_frame_inactive = | 929 SkColor color_frame_inactive = |
| 930 GetBgColor(".headerbar.header-bar.titlebar:backdrop"); | 930 GetBgColor("#headerbar.header-bar.titlebar:backdrop"); |
| 931 colors_[ThemeProperties::COLOR_FRAME] = color_frame; | 931 colors_[ThemeProperties::COLOR_FRAME] = color_frame; |
| 932 colors_[ThemeProperties::COLOR_FRAME_INACTIVE] = color_frame_inactive; | 932 colors_[ThemeProperties::COLOR_FRAME_INACTIVE] = color_frame_inactive; |
| 933 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO] = | 933 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO] = |
| 934 color_utils::HSLShift(color_frame, kDefaultTintFrameIncognito); | 934 color_utils::HSLShift(color_frame, kDefaultTintFrameIncognito); |
| 935 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE] = | 935 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE] = |
| 936 color_utils::HSLShift(color_frame_inactive, kDefaultTintFrameIncognito); | 936 color_utils::HSLShift(color_frame_inactive, kDefaultTintFrameIncognito); |
| 937 #endif | 937 #endif |
| 938 } | 938 } |
| 939 | 939 |
| 940 void GtkUi::GetNormalButtonTintHSL(color_utils::HSL* tint) const { | 940 void GtkUi::GetNormalButtonTintHSL(color_utils::HSL* tint) const { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 | 1046 |
| 1047 float GtkUi::GetDeviceScaleFactor() const { | 1047 float GtkUi::GetDeviceScaleFactor() const { |
| 1048 return device_scale_factor_; | 1048 return device_scale_factor_; |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 } // namespace libgtkui | 1051 } // namespace libgtkui |
| 1052 | 1052 |
| 1053 views::LinuxUI* BuildGtkUi() { | 1053 views::LinuxUI* BuildGtkUi() { |
| 1054 return new libgtkui::GtkUi; | 1054 return new libgtkui::GtkUi; |
| 1055 } | 1055 } |
| OLD | NEW |