summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-07 17:44:53 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-07 17:44:53 +0000
commit822badd170af1f42c4de5d4d3c08157ceb65335d (patch)
tree60a8bbb4de3ba1c5a7c0880191f523d9f687c329 /ui
parent9f271a3add5958d0b26105da0f7cbc30fb028fa3 (diff)
downloadchromium_src-822badd170af1f42c4de5d4d3c08157ceb65335d.zip
chromium_src-822badd170af1f42c4de5d4d3c08157ceb65335d.tar.gz
chromium_src-822badd170af1f42c4de5d4d3c08157ceb65335d.tar.bz2
Remove some static initializers caused by colors in gtk_hig_constants.h.
- Remove kGdkGreen (only used in one place) and kGdkGray (used in 3 places for a disabled text field). - Inline the definition of kGdkBlack and kGdkWhite to avoid copy being run as a static initializer. BUG=94925 Review URL: http://codereview.chromium.org/7838014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/base/gtk/gtk_hig_constants.cc16
-rw-r--r--ui/base/gtk/gtk_hig_constants.h17
-rw-r--r--ui/ui.gyp1
3 files changed, 8 insertions, 26 deletions
diff --git a/ui/base/gtk/gtk_hig_constants.cc b/ui/base/gtk/gtk_hig_constants.cc
deleted file mode 100644
index f9d0280c..0000000
--- a/ui/base/gtk/gtk_hig_constants.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/base/gtk/gtk_hig_constants.h"
-
-#include <gdk/gdk.h>
-
-namespace ui {
-
-const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff);
-const GdkColor kGdkGray = GDK_COLOR_RGB(0x7f, 0x7f, 0x7f);
-const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00);
-const GdkColor kGdkGreen = GDK_COLOR_RGB(0x00, 0xff, 0x00);
-
-} // namespace ui
diff --git a/ui/base/gtk/gtk_hig_constants.h b/ui/base/gtk/gtk_hig_constants.h
index d868b2a..96694c4 100644
--- a/ui/base/gtk/gtk_hig_constants.h
+++ b/ui/base/gtk/gtk_hig_constants.h
@@ -15,16 +15,20 @@
typedef struct _GdkColor GdkColor;
+// Define a macro for creating GdkColors from RGB values. This is a macro to
+// allow static construction of literals, etc. Use this like:
+// GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff);
+#define GDK_COLOR_RGB(r, g, b) {0, r * ::ui::kSkiaToGDKMultiplier, \
+ g * ::ui::kSkiaToGDKMultiplier, b * ::ui::kSkiaToGDKMultiplier}
+
namespace ui {
// Multiply uint8 color components by this.
const int kSkiaToGDKMultiplier = 257;
// Named color constants.
-UI_EXPORT extern const GdkColor kGdkWhite;
-UI_EXPORT extern const GdkColor kGdkGray;
-UI_EXPORT extern const GdkColor kGdkBlack;
-UI_EXPORT extern const GdkColor kGdkGreen;
+const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff);
+const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00);
// Constants relating to the layout of dialog windows:
// (See http://library.gnome.org/devel/hig-book/stable/design-window.html.en)
@@ -49,10 +53,5 @@ const int kFormControlSpacing = 10;
} // namespace ui
-// Define a macro for creating GdkColors from RGB values. This is a macro to
-// allow static construction of literals, etc. Use this like:
-// GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff);
-#define GDK_COLOR_RGB(r, g, b) {0, r * ::ui::kSkiaToGDKMultiplier, \
- g * ::ui::kSkiaToGDKMultiplier, b * ::ui::kSkiaToGDKMultiplier}
#endif // UI_BASE_GTK_GTK_HIG_CONSTANTS_H_
diff --git a/ui/ui.gyp b/ui/ui.gyp
index e3a30ee..de83e00 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -112,7 +112,6 @@
'base/gtk/gtk_floating_container.h',
'base/gtk/gtk_im_context_util.cc',
'base/gtk/gtk_im_context_util.h',
- 'base/gtk/gtk_hig_constants.cc',
'base/gtk/gtk_hig_constants.h',
'base/gtk/gtk_signal.h',
'base/gtk/gtk_signal_registrar.cc',