summaryrefslogtreecommitdiffstats
path: root/gfx
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:06:45 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:06:45 +0000
commita502bbe7a3ea0d4909e4e163ab00a1f3be483143 (patch)
treec53bf6b7492be39d1fb2eaa4cacbc74f8d0c8cb1 /gfx
parent8ebb7703fb1fd95f993081e674d04167fe1413fc (diff)
downloadchromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.zip
chromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.tar.gz
chromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.tar.bz2
Start sorting methods in class declarations.
A lot of our headers are a mess and aren't organized. Impose the following order on files in the base/ directory: class Blah { each public/protected/private section: typedefs; enums; static constants; ctors; dtors; methods; overridden virtual methods; data members; }; BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gfx.gyp3
-rw-r--r--gfx/native_theme_linux.h8
-rw-r--r--gfx/platform_font_gtk.h8
-rw-r--r--gfx/test_suite.cc48
-rw-r--r--gfx/test_suite.h48
5 files changed, 63 insertions, 52 deletions
diff --git a/gfx/gfx.gyp b/gfx/gfx.gyp
index df7d5de..579d3b5 100644
--- a/gfx/gfx.gyp
+++ b/gfx/gfx.gyp
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# 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.
@@ -32,6 +32,7 @@
'run_all_unittests.cc',
'scoped_image_unittest.cc',
'skbitmap_operations_unittest.cc',
+ 'test_suite.cc',
'test_suite.h',
'<(SHARED_INTERMEDIATE_DIR)/gfx/gfx_resources.rc',
],
diff --git a/gfx/native_theme_linux.h b/gfx/native_theme_linux.h
index 62a84e9..4a79da3 100644
--- a/gfx/native_theme_linux.h
+++ b/gfx/native_theme_linux.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -19,9 +19,6 @@ class Size;
// Linux theming API.
class NativeThemeLinux {
public:
- // Gets our singleton instance.
- static NativeThemeLinux* instance();
-
// The part to be painted / sized.
enum Part {
kScrollbarDownArrow,
@@ -54,6 +51,9 @@ class NativeThemeLinux {
ScrollbarTrackExtraParams scrollbar_track;
};
+ // Gets our singleton instance.
+ static NativeThemeLinux* instance();
+
// Return the size of the part.
virtual gfx::Size GetSize(Part part) const;
// Paint the part to the canvas.
diff --git a/gfx/platform_font_gtk.h b/gfx/platform_font_gtk.h
index d36142d..a7f3c21 100644
--- a/gfx/platform_font_gtk.h
+++ b/gfx/platform_font_gtk.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -27,6 +27,9 @@ class PlatformFontGtk : public PlatformFont {
// pango_font_description_free().
static PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font);
+ // Return the scale factor for fonts that account for DPI.
+ static float GetPangoScaleFactor();
+
// Position as an offset from the height of the drawn text, used to draw
// an underline. This is a negative number, so the underline would be
// drawn at y + height + underline_position;
@@ -46,9 +49,6 @@ class PlatformFontGtk : public PlatformFont {
virtual int GetFontSize() const;
virtual NativeFont GetNativeFont() const;
- // Return the scale factor for fonts that account for DPI.
- static float GetPangoScaleFactor();
-
private:
// Create a new instance of this object with the specified properties. Called
// from DeriveFont.
diff --git a/gfx/test_suite.cc b/gfx/test_suite.cc
new file mode 100644
index 0000000..02e1f7f
--- /dev/null
+++ b/gfx/test_suite.cc
@@ -0,0 +1,48 @@
+// 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 "gfx/test_suite.h"
+
+#include "gfx/gfx_paths.h"
+#include "base/file_path.h"
+#include "base/path_service.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
+
+#if defined(OS_MACOSX)
+#include "base/mac/mac_util.h"
+#endif
+
+GfxTestSuite::GfxTestSuite(int argc, char** argv) : TestSuite(argc, argv) {}
+
+void GfxTestSuite::Initialize() {
+ base::mac::ScopedNSAutoreleasePool autorelease_pool;
+
+ TestSuite::Initialize();
+
+ gfx::RegisterPathProvider();
+
+#if defined(OS_MACOSX)
+ // Look in the framework bundle for resources.
+ // TODO(port): make a resource bundle for non-app exes. What's done here
+ // isn't really right because this code needs to depend on chrome_dll
+ // being built. This is inappropriate in app.
+ FilePath path;
+ PathService::Get(base::DIR_EXE, &path);
+#if defined(GOOGLE_CHROME_BUILD)
+ path = path.AppendASCII("Google Chrome Framework.framework");
+#elif defined(CHROMIUM_BUILD)
+ path = path.AppendASCII("Chromium Framework.framework");
+#else
+#error Unknown branding
+#endif
+ base::mac::SetOverrideAppBundlePath(path);
+#endif // OS_MACOSX
+}
+
+void GfxTestSuite::Shutdown() {
+#if defined(OS_MACOSX)
+ base::mac::SetOverrideAppBundle(NULL);
+#endif
+ TestSuite::Shutdown();
+}
diff --git a/gfx/test_suite.h b/gfx/test_suite.h
index 8e09e35..7c6ffbd 100644
--- a/gfx/test_suite.h
+++ b/gfx/test_suite.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -8,55 +8,17 @@
#include <string>
-#include "gfx/gfx_paths.h"
-#include "base/file_path.h"
-#include "base/path_service.h"
-#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
-#if defined(OS_MACOSX)
-#include "base/mac/mac_util.h"
-#endif
-
class GfxTestSuite : public base::TestSuite {
public:
- GfxTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
- }
+ GfxTestSuite(int argc, char** argv);
protected:
-
- virtual void Initialize() {
- base::mac::ScopedNSAutoreleasePool autorelease_pool;
-
- TestSuite::Initialize();
-
- gfx::RegisterPathProvider();
-
-#if defined(OS_MACOSX)
- // Look in the framework bundle for resources.
- // TODO(port): make a resource bundle for non-app exes. What's done here
- // isn't really right because this code needs to depend on chrome_dll
- // being built. This is inappropriate in app.
- FilePath path;
- PathService::Get(base::DIR_EXE, &path);
-#if defined(GOOGLE_CHROME_BUILD)
- path = path.AppendASCII("Google Chrome Framework.framework");
-#elif defined(CHROMIUM_BUILD)
- path = path.AppendASCII("Chromium Framework.framework");
-#else
-#error Unknown branding
-#endif
- base::mac::SetOverrideAppBundlePath(path);
-#endif // OS_MACOSX
- }
-
- virtual void Shutdown() {
-#if defined(OS_MACOSX)
- base::mac::SetOverrideAppBundle(NULL);
-#endif
- TestSuite::Shutdown();
- }
+ // Overridden from base::TestSuite:
+ virtual void Initialize();
+ virtual void Shutdown();
};
#endif // GFX_TEST_SUITE_H_