summaryrefslogtreecommitdiffstats
path: root/ui/ozone
diff options
context:
space:
mode:
authorspang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-23 15:38:49 +0000
committerspang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-23 15:38:49 +0000
commitac070beb0bb2b845a972dce24de2f46cfeab71a4 (patch)
treeaeb09feb25148f2d33059945140ccd8fc6501e26 /ui/ozone
parent54991da94f4980216183b980c96cfa55702e4393 (diff)
downloadchromium_src-ac070beb0bb2b845a972dce24de2f46cfeab71a4.zip
chromium_src-ac070beb0bb2b845a972dce24de2f46cfeab71a4.tar.gz
chromium_src-ac070beb0bb2b845a972dce24de2f46cfeab71a4.tar.bz2
ozone: Move all platform definitions to anonymous namespace
There is no reason to expose the platform objects. They are constructed via a static function and never used except via the OzonePlatform base class. TEST=build BUG=none NOTRY=true Review URL: https://codereview.chromium.org/247963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/ozone')
-rw-r--r--ui/ozone/platform/caca/ozone_platform_caca.cc65
-rw-r--r--ui/ozone/platform/caca/ozone_platform_caca.h37
-rw-r--r--ui/ozone/platform/dri/ozone_platform_dri.cc70
-rw-r--r--ui/ozone/platform/dri/ozone_platform_dri.h35
-rw-r--r--ui/ozone/platform/test/ozone_platform_test.cc65
-rw-r--r--ui/ozone/platform/test/ozone_platform_test.h34
6 files changed, 130 insertions, 176 deletions
diff --git a/ui/ozone/platform/caca/ozone_platform_caca.cc b/ui/ozone/platform/caca/ozone_platform_caca.cc
index 6a35c6b..9c557c2 100644
--- a/ui/ozone/platform/caca/ozone_platform_caca.cc
+++ b/ui/ozone/platform/caca/ozone_platform_caca.cc
@@ -4,8 +4,11 @@
#include "ui/ozone/platform/caca/ozone_platform_caca.h"
+#include "ui/base/cursor/ozone/cursor_factory_ozone.h"
#include "ui/ozone/ozone_platform.h"
#include "ui/ozone/platform/caca/caca_connection.h"
+#include "ui/ozone/platform/caca/caca_event_factory.h"
+#include "ui/ozone/platform/caca/caca_surface_factory.h"
#if defined(OS_CHROMEOS)
#include "ui/ozone/common/chromeos/native_display_delegate_ozone.h"
@@ -13,37 +16,49 @@
namespace ui {
-OzonePlatformCaca::OzonePlatformCaca()
- : connection_(),
- surface_factory_ozone_(&connection_),
- event_factory_ozone_(&connection_) {}
+namespace {
-OzonePlatformCaca::~OzonePlatformCaca() {}
+class OzonePlatformCaca : public OzonePlatform {
+ public:
+ OzonePlatformCaca()
+ : surface_factory_ozone_(&connection_),
+ event_factory_ozone_(&connection_) {}
+ virtual ~OzonePlatformCaca() {}
-gfx::SurfaceFactoryOzone* OzonePlatformCaca::GetSurfaceFactoryOzone() {
- return &surface_factory_ozone_;
-}
+ // OzonePlatform:
+ virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ return &surface_factory_ozone_;
+ }
+ virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
+ return &event_factory_ozone_;
+ }
+ virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
+ OVERRIDE {
+ return &input_method_context_factory_ozone_;
+ }
+ virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ return &cursor_factory_ozone_;
+ }
-ui::EventFactoryOzone* OzonePlatformCaca::GetEventFactoryOzone() {
- return &event_factory_ozone_;
-}
+#if defined(OS_CHROMEOS)
+ virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
+ OVERRIDE {
+ return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
+ }
+#endif
-ui::InputMethodContextFactoryOzone*
-OzonePlatformCaca::GetInputMethodContextFactoryOzone() {
- return &input_method_context_factory_ozone_;
-}
+ private:
+ CacaConnection connection_;
+ CacaSurfaceFactory surface_factory_ozone_;
+ CacaEventFactory event_factory_ozone_;
+ // This creates a minimal input context.
+ InputMethodContextFactoryOzone input_method_context_factory_ozone_;
+ CursorFactoryOzone cursor_factory_ozone_;
-ui::CursorFactoryOzone* OzonePlatformCaca::GetCursorFactoryOzone() {
- return &cursor_factory_ozone_;
-}
+ DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca);
+};
-#if defined(OS_CHROMEOS)
-scoped_ptr<ui::NativeDisplayDelegate>
-OzonePlatformCaca::CreateNativeDisplayDelegate() {
- return scoped_ptr<ui::NativeDisplayDelegate>(
- new NativeDisplayDelegateOzone());
-}
-#endif
+} // namespace
OzonePlatform* CreateOzonePlatformCaca() { return new OzonePlatformCaca; }
diff --git a/ui/ozone/platform/caca/ozone_platform_caca.h b/ui/ozone/platform/caca/ozone_platform_caca.h
index f25b947..bf1f735 100644
--- a/ui/ozone/platform/caca/ozone_platform_caca.h
+++ b/ui/ozone/platform/caca/ozone_platform_caca.h
@@ -5,45 +5,12 @@
#ifndef UI_OZONE_PLATFORM_CACA_OZONE_PLATFORM_CACA_H_
#define UI_OZONE_PLATFORM_CACA_OZONE_PLATFORM_CACA_H_
-#include "ui/base/cursor/ozone/cursor_factory_ozone.h"
-#include "ui/ozone/ozone_export.h"
-#include "ui/ozone/ozone_platform.h"
-#include "ui/ozone/platform/caca/caca_connection.h"
-#include "ui/ozone/platform/caca/caca_event_factory.h"
-#include "ui/ozone/platform/caca/caca_surface_factory.h"
-
namespace ui {
-class CacaConnection;
-
-class OzonePlatformCaca : public OzonePlatform {
- public:
- OzonePlatformCaca();
- virtual ~OzonePlatformCaca();
-
- virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE;
- virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE;
- virtual ui::InputMethodContextFactoryOzone*
- GetInputMethodContextFactoryOzone() OVERRIDE;
- virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE;
-#if defined(OS_CHROMEOS)
- virtual scoped_ptr<ui::NativeDisplayDelegate>
- CreateNativeDisplayDelegate() OVERRIDE;
-#endif
-
- private:
- ui::CacaConnection connection_;
- ui::CacaSurfaceFactory surface_factory_ozone_;
- ui::CacaEventFactory event_factory_ozone_;
- // This creates a minimal input context.
- ui::InputMethodContextFactoryOzone input_method_context_factory_ozone_;
- ui::CursorFactoryOzone cursor_factory_ozone_;
-
- DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca);
-};
+class OzonePlatform;
// Constructor hook for use in ozone_platform_list.cc
-OZONE_EXPORT OzonePlatform* CreateOzonePlatformCaca();
+OzonePlatform* CreateOzonePlatformCaca();
} // namespace ui
diff --git a/ui/ozone/platform/dri/ozone_platform_dri.cc b/ui/ozone/platform/dri/ozone_platform_dri.cc
index 4a9149e..bd0561f 100644
--- a/ui/ozone/platform/dri/ozone_platform_dri.cc
+++ b/ui/ozone/platform/dri/ozone_platform_dri.cc
@@ -5,7 +5,11 @@
#include "ui/ozone/platform/dri/ozone_platform_dri.h"
#include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
+#include "ui/events/ozone/evdev/event_factory_evdev.h"
+#include "ui/ozone/ime/input_method_context_factory_ozone.h"
#include "ui/ozone/ozone_platform.h"
+#include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h"
+#include "ui/ozone/platform/dri/dri_surface_factory.h"
#if defined(OS_CHROMEOS)
#include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h"
@@ -13,36 +17,52 @@
namespace ui {
-OzonePlatformDri::OzonePlatformDri()
- : cursor_factory_ozone_(&surface_factory_ozone_),
- event_factory_ozone_(&cursor_factory_ozone_) {}
+namespace {
-OzonePlatformDri::~OzonePlatformDri() {}
+// OzonePlatform for Linux DRI (Direct Rendering Infrastructure)
+//
+// This platform is Linux without any display server (no X, wayland, or
+// anything). This means chrome alone owns the display and input devices.
+class OzonePlatformDri : public OzonePlatform {
+ public:
+ OzonePlatformDri()
+ : cursor_factory_ozone_(&surface_factory_ozone_),
+ event_factory_ozone_(&cursor_factory_ozone_) {}
+ virtual ~OzonePlatformDri() {}
-gfx::SurfaceFactoryOzone* OzonePlatformDri::GetSurfaceFactoryOzone() {
- return &surface_factory_ozone_;
-}
-
-ui::EventFactoryOzone* OzonePlatformDri::GetEventFactoryOzone() {
- return &event_factory_ozone_;
-}
+ // OzonePlatform:
+ virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ return &surface_factory_ozone_;
+ }
+ virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
+ return &event_factory_ozone_;
+ }
+ virtual ui::InputMethodContextFactoryOzone*
+ GetInputMethodContextFactoryOzone() OVERRIDE {
+ return &input_method_context_factory_ozone_;
+ }
+ virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ return &cursor_factory_ozone_;
+ }
+#if defined(OS_CHROMEOS)
+ virtual scoped_ptr<ui::NativeDisplayDelegate> CreateNativeDisplayDelegate()
+ OVERRIDE {
+ return scoped_ptr<ui::NativeDisplayDelegate>(
+ new NativeDisplayDelegateDri(&surface_factory_ozone_));
+ }
+#endif
-ui::InputMethodContextFactoryOzone*
-OzonePlatformDri::GetInputMethodContextFactoryOzone() {
- return &input_method_context_factory_ozone_;
-}
+ private:
+ ui::DriSurfaceFactory surface_factory_ozone_;
+ ui::CursorFactoryEvdevDri cursor_factory_ozone_;
+ ui::EventFactoryEvdev event_factory_ozone_;
+ // This creates a minimal input context.
+ ui::InputMethodContextFactoryOzone input_method_context_factory_ozone_;
-ui::CursorFactoryOzone* OzonePlatformDri::GetCursorFactoryOzone() {
- return &cursor_factory_ozone_;
-}
+ DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
+};
-#if defined(OS_CHROMEOS)
-scoped_ptr<ui::NativeDisplayDelegate>
-OzonePlatformDri::CreateNativeDisplayDelegate() {
- return scoped_ptr<ui::NativeDisplayDelegate>(
- new NativeDisplayDelegateDri(&surface_factory_ozone_));
-}
-#endif
+} // namespace
OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; }
diff --git a/ui/ozone/platform/dri/ozone_platform_dri.h b/ui/ozone/platform/dri/ozone_platform_dri.h
index b77f822..a63a054 100644
--- a/ui/ozone/platform/dri/ozone_platform_dri.h
+++ b/ui/ozone/platform/dri/ozone_platform_dri.h
@@ -5,42 +5,9 @@
#ifndef UI_OZONE_PLATFORM_DRI_OZONE_PLATFORM_DRI_H_
#define UI_OZONE_PLATFORM_DRI_OZONE_PLATFORM_DRI_H_
-#include "ui/events/ozone/evdev/event_factory_evdev.h"
-#include "ui/ozone/ime/input_method_context_factory_ozone.h"
-#include "ui/ozone/ozone_platform.h"
-#include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h"
-#include "ui/ozone/platform/dri/dri_surface_factory.h"
-
namespace ui {
-// OzonePlatform for Linux DRI (Direct Rendering Infrastructure)
-//
-// This platform is Linux without any display server (no X, wayland, or
-// anything). This means chrome alone owns the display and input devices.
-class OzonePlatformDri : public OzonePlatform {
- public:
- OzonePlatformDri();
- virtual ~OzonePlatformDri();
-
- virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE;
- virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE;
- virtual ui::InputMethodContextFactoryOzone*
- GetInputMethodContextFactoryOzone() OVERRIDE;
- virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE;
-#if defined(OS_CHROMEOS)
- virtual scoped_ptr<ui::NativeDisplayDelegate>
- CreateNativeDisplayDelegate() OVERRIDE;
-#endif
-
- private:
- ui::DriSurfaceFactory surface_factory_ozone_;
- ui::CursorFactoryEvdevDri cursor_factory_ozone_;
- ui::EventFactoryEvdev event_factory_ozone_;
- // This creates a minimal input context.
- ui::InputMethodContextFactoryOzone input_method_context_factory_ozone_;
-
- DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
-};
+class OzonePlatform;
// Constructor hook for use in ozone_platform_list.cc
OzonePlatform* CreateOzonePlatformDri();
diff --git a/ui/ozone/platform/test/ozone_platform_test.cc b/ui/ozone/platform/test/ozone_platform_test.cc
index 2a84895..2b77b0e 100644
--- a/ui/ozone/platform/test/ozone_platform_test.cc
+++ b/ui/ozone/platform/test/ozone_platform_test.cc
@@ -6,6 +6,10 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "ui/base/cursor/ozone/cursor_factory_ozone.h"
+#include "ui/events/ozone/evdev/event_factory_evdev.h"
+#include "ui/gfx/ozone/impl/file_surface_factory.h"
+#include "ui/ozone/ime/input_method_context_factory_ozone.h"
#include "ui/ozone/ozone_platform.h"
#include "ui/ozone/ozone_switches.h"
@@ -15,36 +19,49 @@
namespace ui {
-OzonePlatformTest::OzonePlatformTest(const base::FilePath& dump_file)
- : surface_factory_ozone_(dump_file) {}
+namespace {
-OzonePlatformTest::~OzonePlatformTest() {}
+// OzonePlatform for testing
+//
+// This platform dumps images to a file for testing purposes.
+class OzonePlatformTest : public OzonePlatform {
+ public:
+ OzonePlatformTest(const base::FilePath& dump_file)
+ : surface_factory_ozone_(dump_file) {}
+ virtual ~OzonePlatformTest() {}
-gfx::SurfaceFactoryOzone* OzonePlatformTest::GetSurfaceFactoryOzone() {
- return &surface_factory_ozone_;
-}
+ // OzonePlatform:
+ virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ return &surface_factory_ozone_;
+ }
+ virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
+ return &event_factory_ozone_;
+ }
+ virtual ui::InputMethodContextFactoryOzone*
+ GetInputMethodContextFactoryOzone() OVERRIDE {
+ return &input_method_context_factory_ozone_;
+ }
+ virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ return &cursor_factory_ozone_;
+ }
-ui::EventFactoryOzone* OzonePlatformTest::GetEventFactoryOzone() {
- return &event_factory_ozone_;
-}
+#if defined(OS_CHROMEOS)
+ scoped_ptr<ui::NativeDisplayDelegate> CreateNativeDisplayDelegate() {
+ return scoped_ptr<ui::NativeDisplayDelegate>(
+ new NativeDisplayDelegateOzone());
+ }
+#endif
-ui::InputMethodContextFactoryOzone*
-OzonePlatformTest::GetInputMethodContextFactoryOzone() {
- return &input_method_context_factory_ozone_;
-}
+ private:
+ gfx::FileSurfaceFactory surface_factory_ozone_;
+ ui::EventFactoryEvdev event_factory_ozone_;
+ ui::InputMethodContextFactoryOzone input_method_context_factory_ozone_;
+ ui::CursorFactoryOzone cursor_factory_ozone_;
-ui::CursorFactoryOzone* OzonePlatformTest::GetCursorFactoryOzone() {
- return &cursor_factory_ozone_;
-}
+ DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest);
+};
-#if defined(OS_CHROMEOS)
-scoped_ptr<ui::NativeDisplayDelegate>
-OzonePlatformTest::CreateNativeDisplayDelegate() {
- return scoped_ptr<ui::NativeDisplayDelegate>(
- new NativeDisplayDelegateOzone());
- return scoped_ptr<ui::NativeDisplayDelegate>();
-}
-#endif
+} // namespace
OzonePlatform* CreateOzonePlatformTest() {
CommandLine* cmd = CommandLine::ForCurrentProcess();
diff --git a/ui/ozone/platform/test/ozone_platform_test.h b/ui/ozone/platform/test/ozone_platform_test.h
index b2695e0..fb25fd6 100644
--- a/ui/ozone/platform/test/ozone_platform_test.h
+++ b/ui/ozone/platform/test/ozone_platform_test.h
@@ -5,41 +5,9 @@
#ifndef UI_OZONE_PLATFORM_TEST_OZONE_PLATFORM_TEST_H_
#define UI_OZONE_PLATFORM_TEST_OZONE_PLATFORM_TEST_H_
-#include "base/files/file_path.h"
-#include "ui/base/cursor/ozone/cursor_factory_ozone.h"
-#include "ui/events/ozone/evdev/event_factory_evdev.h"
-#include "ui/gfx/ozone/impl/file_surface_factory.h"
-#include "ui/ozone/ime/input_method_context_factory_ozone.h"
-#include "ui/ozone/ozone_platform.h"
-
namespace ui {
-// OzonePlatform for testing
-//
-// This platform dumps images to a file for testing purposes.
-class OzonePlatformTest : public OzonePlatform {
- public:
- OzonePlatformTest(const base::FilePath& dump_file);
- virtual ~OzonePlatformTest();
-
- virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE;
- virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE;
- virtual ui::InputMethodContextFactoryOzone*
- GetInputMethodContextFactoryOzone() OVERRIDE;
- virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE;
-#if defined(OS_CHROMEOS)
- virtual scoped_ptr<ui::NativeDisplayDelegate>
- CreateNativeDisplayDelegate() OVERRIDE;
-#endif
-
- private:
- gfx::FileSurfaceFactory surface_factory_ozone_;
- ui::EventFactoryEvdev event_factory_ozone_;
- ui::InputMethodContextFactoryOzone input_method_context_factory_ozone_;
- ui::CursorFactoryOzone cursor_factory_ozone_;
-
- DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest);
-};
+class OzonePlatform;
// Constructor hook for use in ozone_platform_list.cc
OzonePlatform* CreateOzonePlatformTest();