Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/ui/libgtkui/gtk_ui.cc

Issue 2783433002: Gtk3: Use menubar instead of headerbar on version less than 3.10 (Closed)
Patch Set: Remove bogus line Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/libgtkui/gtk_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <X11/Xcursor/Xcursor.h> 7 #include <X11/Xcursor/Xcursor.h>
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <math.h> 9 #include <math.h>
10 #include <pango/pango.h> 10 #include <pango/pango.h>
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 colors_[ThemeProperties::COLOR_NTP_TEXT] = native_theme_->GetSystemColor( 857 colors_[ThemeProperties::COLOR_NTP_TEXT] = native_theme_->GetSystemColor(
858 ui::NativeTheme::kColorId_TextfieldDefaultColor); 858 ui::NativeTheme::kColorId_TextfieldDefaultColor);
859 // The NTP header is the color that surrounds the current active 859 // The NTP header is the color that surrounds the current active
860 // thumbnail on the NTP, and acts as the border of the "Recent 860 // thumbnail on the NTP, and acts as the border of the "Recent
861 // Links" box. It would be awesome if they were separated so we 861 // Links" box. It would be awesome if they were separated so we
862 // could use GetBorderColor() for the border around the "Recent 862 // could use GetBorderColor() for the border around the "Recent
863 // Links" section, but matching the frame color is more important. 863 // Links" section, but matching the frame color is more important.
864 colors_[ThemeProperties::COLOR_NTP_HEADER] = 864 colors_[ThemeProperties::COLOR_NTP_HEADER] =
865 colors_[ThemeProperties::COLOR_FRAME]; 865 colors_[ThemeProperties::COLOR_FRAME];
866 #else 866 #else
867 SkColor frame_color = GetBgColor("#headerbar.header-bar.titlebar"); 867 std::string header_selector = GtkVersionCheck(3, 10)
868 SkColor frame_color_inactive = 868 ? "#headerbar.header-bar.titlebar"
869 GetBgColor("#headerbar.header-bar.titlebar:backdrop"); 869 : "GtkMenuBar#menubar";
870 SkColor frame_color = GetBgColor(header_selector);
871 SkColor frame_color_inactive = GetBgColor(header_selector + ":backdrop");
870 colors_[ThemeProperties::COLOR_FRAME] = frame_color; 872 colors_[ThemeProperties::COLOR_FRAME] = frame_color;
871 colors_[ThemeProperties::COLOR_FRAME_INACTIVE] = frame_color_inactive; 873 colors_[ThemeProperties::COLOR_FRAME_INACTIVE] = frame_color_inactive;
872 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO] = 874 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO] =
873 color_utils::HSLShift(frame_color, kDefaultTintFrameIncognito); 875 color_utils::HSLShift(frame_color, kDefaultTintFrameIncognito);
874 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE] = 876 colors_[ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE] =
875 color_utils::HSLShift(frame_color_inactive, kDefaultTintFrameIncognito); 877 color_utils::HSLShift(frame_color_inactive, kDefaultTintFrameIncognito);
876 878
877 SkColor toolbar_color = GetBgColor("GtkToolbar#toolbar"); 879 SkColor toolbar_color = GetBgColor("GtkToolbar#toolbar");
878 SkColor toolbar_text_color = color_utils::GetReadableColor( 880 SkColor toolbar_text_color = color_utils::GetReadableColor(
879 GetFgColor("GtkToolbar#toolbar GtkLabel#label"), 881 GetFgColor("GtkToolbar#toolbar GtkLabel#label"),
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 // Separates entries in the downloads bar. 916 // Separates entries in the downloads bar.
915 colors_[ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR] = 917 colors_[ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR] =
916 toolbar_button_border; 918 toolbar_button_border;
917 // Separates the bookmark bar from the web content. 919 // Separates the bookmark bar from the web content.
918 colors_[ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR] = 920 colors_[ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR] =
919 toolbar_button_border; 921 toolbar_button_border;
920 922
921 // These colors represent the border drawn around tabs and between 923 // These colors represent the border drawn around tabs and between
922 // the tabstrip and toolbar. 924 // the tabstrip and toolbar.
923 SkColor toolbar_top_separator = GetToolbarTopSeparatorColor( 925 SkColor toolbar_top_separator = GetToolbarTopSeparatorColor(
924 GetBorderColor("#headerbar.header-bar.titlebar GtkButton#button"), 926 GetBorderColor(header_selector + " GtkButton#button"), frame_color,
925 frame_color, toolbar_button_border, toolbar_color); 927 toolbar_button_border, toolbar_color);
926 SkColor toolbar_top_separator_inactive = GetToolbarTopSeparatorColor( 928 SkColor toolbar_top_separator_inactive = GetToolbarTopSeparatorColor(
927 GetBorderColor( 929 GetBorderColor(header_selector + ":backdrop GtkButton#button"),
928 "#headerbar.header-bar.titlebar:backdrop GtkButton#button"),
929 frame_color_inactive, toolbar_button_border, toolbar_color); 930 frame_color_inactive, toolbar_button_border, toolbar_color);
930 // Unlike with toolbars, we always want a border around tabs, so let 931 // Unlike with toolbars, we always want a border around tabs, so let
931 // ThemeService choose the border color if the theme doesn't provide one. 932 // ThemeService choose the border color if the theme doesn't provide one.
932 if (SkColorGetA(toolbar_top_separator) && 933 if (SkColorGetA(toolbar_top_separator) &&
933 SkColorGetA(toolbar_top_separator_inactive)) { 934 SkColorGetA(toolbar_top_separator_inactive)) {
934 colors_[ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR] = 935 colors_[ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR] =
935 toolbar_top_separator; 936 toolbar_top_separator;
936 colors_[ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE] = 937 colors_[ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE] =
937 toolbar_top_separator_inactive; 938 toolbar_top_separator_inactive;
938 } 939 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 1070
1070 float GtkUi::GetDeviceScaleFactor() const { 1071 float GtkUi::GetDeviceScaleFactor() const {
1071 return device_scale_factor_; 1072 return device_scale_factor_;
1072 } 1073 }
1073 1074
1074 } // namespace libgtkui 1075 } // namespace libgtkui
1075 1076
1076 views::LinuxUI* BuildGtkUi() { 1077 views::LinuxUI* BuildGtkUi() {
1077 return new libgtkui::GtkUi; 1078 return new libgtkui::GtkUi;
1078 } 1079 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/libgtkui/gtk_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698