Commit 2705e490 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ozone: Remove InputMethodContextFactoryOzone and FakeInputMethodContextOzone.

FakeInputMethodContextOzone is the same as FakeInputMethodContext, and there's no
other use for InputMethodContextFactoryOzone. So remove both. The ozone platform
can directly set an IME context using LinuxInputMethodContextFactory::SetInstance
if so desired.

BUG=361137
R=sky@chromium.org, spang@chromium.org, yukishiino@chromium.org

Review URL: https://codereview.chromium.org/284323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271170 0039d316-1c4b-4281-b951-d872f2087c98
parent 0311d4cc
......@@ -29,7 +29,7 @@
#include "base/mac/scoped_nsautorelease_pool.h"
#endif
#if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(USE_X11)
#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
#include "ui/base/ime/input_method_initializer.h"
#endif
......@@ -91,7 +91,7 @@ void ContentBrowserTest::SetUp() {
#endif
// LinuxInputMethodContextFactory has to be initialized.
#if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(USE_X11)
#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
ui::InitializeInputMethodForTesting();
#endif
......
......@@ -12,7 +12,7 @@
#include "base/win/metro.h"
#include "ui/base/ime/input_method_win.h"
#include "ui/base/ime/remote_input_method_win.h"
#elif defined(USE_AURA) && defined(OS_LINUX)
#elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
#include "ui/base/ime/input_method_auralinux.h"
#else
#include "ui/base/ime/input_method_minimal.h"
......@@ -43,7 +43,7 @@ scoped_ptr<InputMethod> CreateInputMethod(
if (IsRemoteInputMethodWinRequired(widget))
return CreateRemoteInputMethodWin(delegate);
return scoped_ptr<InputMethod>(new InputMethodWin(delegate, widget));
#elif defined(USE_AURA) && defined(OS_LINUX)
#elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
return scoped_ptr<InputMethod>(new InputMethodAuraLinux(delegate));
#else
return scoped_ptr<InputMethod>(new InputMethodMinimal(delegate));
......
......@@ -6,15 +6,14 @@
#if defined(OS_CHROMEOS)
#include "ui/base/ime/chromeos/ime_bridge.h"
#elif defined(USE_AURA) && defined(OS_LINUX) && !defined(USE_OZONE)
#elif defined(USE_AURA) && defined(OS_LINUX)
#include "base/logging.h"
#include "ui/base/ime/linux/fake_input_method_context_factory.h"
#endif
namespace {
#if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) && \
!defined(USE_OZONE)
#if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX)
const ui::LinuxInputMethodContextFactory* g_linux_input_method_context_factory;
#endif
......@@ -37,7 +36,7 @@ void ShutdownInputMethod() {
void InitializeInputMethodForTesting() {
#if defined(OS_CHROMEOS)
chromeos::IMEBridge::Initialize();
#elif defined(USE_AURA) && defined(OS_LINUX) && !defined(USE_OZONE)
#elif defined(USE_AURA) && defined(OS_LINUX)
if (!g_linux_input_method_context_factory)
g_linux_input_method_context_factory = new FakeInputMethodContextFactory();
const LinuxInputMethodContextFactory* factory =
......@@ -53,7 +52,7 @@ void InitializeInputMethodForTesting() {
void ShutdownInputMethodForTesting() {
#if defined(OS_CHROMEOS)
chromeos::IMEBridge::Shutdown();
#elif defined(USE_AURA) && defined(OS_LINUX) && !defined(USE_OZONE)
#elif defined(USE_AURA) && defined(OS_LINUX)
const LinuxInputMethodContextFactory* factory =
LinuxInputMethodContextFactory::instance();
CHECK(!factory || factory == g_linux_input_method_context_factory)
......
......@@ -19,10 +19,6 @@ component("ozone") {
# "chromeos" folder name.
"common/chromeos/native_display_delegate_ozone.cc",
"common/chromeos/native_display_delegate_ozone.h",
"ime/fake_input_method_context_ozone.cc",
"ime/fake_input_method_context_ozone.h",
"ime/input_method_context_factory_ozone.cc",
"ime/input_method_context_factory_ozone.h",
"ozone_platform.cc",
"ozone_platform.h",
"ozone_switches.cc",
......
include_rules = [
"+ui/base/ime",
]
// Copyright 2013 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/ozone/ime/fake_input_method_context_ozone.h"
namespace ui {
FakeInputMethodContextOzone::FakeInputMethodContextOzone() {
}
FakeInputMethodContextOzone::~FakeInputMethodContextOzone() {
}
bool FakeInputMethodContextOzone::DispatchKeyEvent(
const ui::KeyEvent& /* key_event */) {
return false;
}
void FakeInputMethodContextOzone::Reset() {
}
void FakeInputMethodContextOzone::OnTextInputTypeChanged(
ui::TextInputType /* text_input_type */) {
}
void FakeInputMethodContextOzone::OnCaretBoundsChanged(
const gfx::Rect& /* caret_bounds */) {
}
} // namespace ui
// Copyright 2013 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.
#ifndef UI_OZONE_IME_FAKE_INPUT_METHOD_CONTEXT_OZONE_H_
#define UI_OZONE_IME_FAKE_INPUT_METHOD_CONTEXT_OZONE_H_
#include "ui/base/ime/linux/linux_input_method_context.h"
namespace ui {
// A fake implementation of LinuxInputMethodContext, which does nothing.
class FakeInputMethodContextOzone :
public LinuxInputMethodContext {
public:
FakeInputMethodContextOzone();
virtual ~FakeInputMethodContextOzone();
// Overriden from ui::LinuxInputMethodContext
virtual bool DispatchKeyEvent(const ui::KeyEvent& key_event) OVERRIDE;
virtual void Reset() OVERRIDE;
virtual void OnTextInputTypeChanged(ui::TextInputType text_input_type)
OVERRIDE;
virtual void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(FakeInputMethodContextOzone);
};
} // namespace ui
#endif // UI_OZONE_IME_FAKE_INPUT_METHOD_CONTEXT_OZONE_H_
# Copyright 2013 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.
{
'dependencies': [
'<(DEPTH)/ui/base/ui_base.gyp:ui_base',
],
'sources': [
'fake_input_method_context_ozone.cc',
'fake_input_method_context_ozone.h',
'input_method_context_factory_ozone.cc',
'input_method_context_factory_ozone.h',
],
}
// Copyright 2013 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/ozone/ime/input_method_context_factory_ozone.h"
#include "ui/ozone/ime/fake_input_method_context_ozone.h"
namespace ui {
InputMethodContextFactoryOzone::InputMethodContextFactoryOzone() {
}
InputMethodContextFactoryOzone::~InputMethodContextFactoryOzone() {
}
scoped_ptr<LinuxInputMethodContext>
InputMethodContextFactoryOzone::CreateInputMethodContext(
LinuxInputMethodContextDelegate* /*delegate*/) const {
return scoped_ptr<LinuxInputMethodContext>(new FakeInputMethodContextOzone());
}
} // namespace ui
// Copyright 2013 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.
#ifndef UI_OZONE_IME_INPUT_METHOD_CONTEXT_FACTORY_OZONE_H_
#define UI_OZONE_IME_INPUT_METHOD_CONTEXT_FACTORY_OZONE_H_
#include "ui/base/ime/linux/linux_input_method_context_factory.h"
#include "ui/ozone/ozone_export.h"
namespace ui {
// TODO(kalyan): Move this class to ui/ime, once ui/base/ime is moved to ui/ime.
// An interface that lets different Ozone platforms override the
// CreateInputMethodContext function declared here to return native input method
// contexts.
class OZONE_EXPORT InputMethodContextFactoryOzone :
public LinuxInputMethodContextFactory {
public:
InputMethodContextFactoryOzone();
virtual ~InputMethodContextFactoryOzone();
// By default this returns a minimal input method context.
virtual scoped_ptr<LinuxInputMethodContext> CreateInputMethodContext(
LinuxInputMethodContextDelegate* delegate) const OVERRIDE;
};
} // namespace ui
#endif // UI_OZONE_IME_INPUT_METHOD_CONTEXT_FACTORY_OZONE_H_
......@@ -49,9 +49,6 @@
'ozone_switches.h',
'<@(external_ozone_platform_files)',
],
'includes': [
'ime/ime.gypi',
],
'actions': [
{
'action_name': 'generate_ozone_platform_list',
......
......@@ -5,10 +5,6 @@
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "ui/base/cursor/ozone/cursor_factory_ozone.h"
#include "ui/events/ozone/event_factory_ozone.h"
#include "ui/gfx/ozone/surface_factory_ozone.h"
#include "ui/ozone/ime/input_method_context_factory_ozone.h"
#include "ui/ozone/ozone_platform.h"
#include "ui/ozone/ozone_platform_list.h"
#include "ui/ozone/ozone_switches.h"
......@@ -62,8 +58,6 @@ void OzonePlatform::InitializeForUI() {
return;
g_platform_initialized_ui = true;
instance_->InitializeUI();
ui::InputMethodContextFactoryOzone::SetInstance(
instance_->GetInputMethodContextFactoryOzone());
}
// static
......
......@@ -16,7 +16,6 @@ namespace ui {
class CursorFactoryOzone;
class EventFactoryOzone;
class InputMethodContextFactoryOzone;
class NativeDisplayDelegate;
// Base class for Ozone platform implementations.
......@@ -52,8 +51,6 @@ class OZONE_EXPORT OzonePlatform {
// inject these objects themselves. Ownership is retained by OzonePlatform.
virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0;
virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0;
virtual ui::InputMethodContextFactoryOzone*
GetInputMethodContextFactoryOzone() = 0;
virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0;
#if defined(OS_CHROMEOS)
virtual scoped_ptr<ui::NativeDisplayDelegate>
......
......@@ -5,7 +5,6 @@
#include "ui/ozone/platform/caca/ozone_platform_caca.h"
#include "ui/base/cursor/ozone/cursor_factory_ozone.h"
#include "ui/ozone/ime/input_method_context_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"
......@@ -31,10 +30,6 @@ class OzonePlatformCaca : public OzonePlatform {
virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
return event_factory_ozone_.get();
}
virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
OVERRIDE {
return input_method_context_factory_ozone_.get();
}
virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
return cursor_factory_ozone_.get();
}
......@@ -49,8 +44,6 @@ class OzonePlatformCaca : public OzonePlatform {
virtual void InitializeUI() OVERRIDE {
surface_factory_ozone_.reset(new CacaSurfaceFactory(&connection_));
event_factory_ozone_.reset(new CacaEventFactory(&connection_));
input_method_context_factory_ozone_.reset(
new InputMethodContextFactoryOzone());
cursor_factory_ozone_.reset(new CursorFactoryOzone());
}
......@@ -60,9 +53,6 @@ class OzonePlatformCaca : public OzonePlatform {
CacaConnection connection_;
scoped_ptr<CacaSurfaceFactory> surface_factory_ozone_;
scoped_ptr<CacaEventFactory> event_factory_ozone_;
// This creates a minimal input context.
scoped_ptr<InputMethodContextFactoryOzone>
input_method_context_factory_ozone_;
scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca);
......
......@@ -19,6 +19,7 @@
'../../base/base.gyp:base',
'../../build/linux/system.gyp:dridrm',
'../../skia/skia.gyp:skia',
'../base/ui_base.gyp:ui_base',
'../display/display.gyp:display_types',
'../display/display.gyp:display_util',
'../events/events.gyp:events',
......
......@@ -7,7 +7,6 @@
#include "ui/events/ozone/device/device_manager.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"
......@@ -43,10 +42,6 @@ class OzonePlatformDri : public OzonePlatform {
virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
return event_factory_ozone_.get();
}
virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
OVERRIDE {
return input_method_context_factory_ozone_.get();
}
virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
return cursor_factory_ozone_.get();
}
......@@ -64,8 +59,6 @@ class OzonePlatformDri : public OzonePlatform {
new CursorFactoryEvdevDri(surface_factory_ozone_.get()));
event_factory_ozone_.reset(new EventFactoryEvdev(
cursor_factory_ozone_.get(), device_manager_.get()));
input_method_context_factory_ozone_.reset(
new InputMethodContextFactoryOzone());
}
virtual void InitializeGPU() OVERRIDE {}
......@@ -79,9 +72,6 @@ class OzonePlatformDri : public OzonePlatform {
scoped_ptr<DriSurfaceFactory> surface_factory_ozone_;
scoped_ptr<CursorFactoryEvdevDri> cursor_factory_ozone_;
scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
// This creates a minimal input context.
scoped_ptr<InputMethodContextFactoryOzone>
input_method_context_factory_ozone_;
DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
};
......
......@@ -15,7 +15,6 @@
#include "ui/gfx/ozone/impl/file_surface_factory.h"
#include "ui/gfx/ozone/surface_ozone_egl.h"
#include "ui/gfx/vsync_provider.h"
#include "ui/ozone/ime/input_method_context_factory_ozone.h"
#include "ui/ozone/ozone_platform.h"
#include "ui/ozone/ozone_switches.h"
......@@ -240,10 +239,6 @@ class OzonePlatformEgltest : public OzonePlatform {
virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
return event_factory_ozone_.get();
}
virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
OVERRIDE {
return input_method_context_factory_ozone_.get();
}
virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
return cursor_factory_ozone_.get();
}
......@@ -260,8 +255,6 @@ class OzonePlatformEgltest : public OzonePlatform {
surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_));
event_factory_ozone_.reset(
new EventFactoryEvdev(NULL, device_manager_.get()));
input_method_context_factory_ozone_.reset(
new InputMethodContextFactoryOzone());
cursor_factory_ozone_.reset(new CursorFactoryOzone());
}
......@@ -272,8 +265,6 @@ class OzonePlatformEgltest : public OzonePlatform {
scoped_ptr<DeviceManager> device_manager_;
scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_;
scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
scoped_ptr<InputMethodContextFactoryOzone>
input_method_context_factory_ozone_;
scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
bool shim_initialized_;
......
......@@ -10,7 +10,6 @@
#include "ui/events/ozone/device/device_manager.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"
......@@ -37,10 +36,6 @@ class OzonePlatformTest : public OzonePlatform {
virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
return event_factory_ozone_.get();
}
virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
OVERRIDE {
return input_method_context_factory_ozone_.get();
}
virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
return cursor_factory_ozone_.get();
}
......@@ -57,8 +52,6 @@ class OzonePlatformTest : public OzonePlatform {
surface_factory_ozone_.reset(new gfx::FileSurfaceFactory(file_path_));
event_factory_ozone_.reset(
new EventFactoryEvdev(NULL, device_manager_.get()));
input_method_context_factory_ozone_.reset(
new InputMethodContextFactoryOzone());
cursor_factory_ozone_.reset(new CursorFactoryOzone());
}
......@@ -68,8 +61,6 @@ class OzonePlatformTest : public OzonePlatform {
scoped_ptr<DeviceManager> device_manager_;
scoped_ptr<gfx::FileSurfaceFactory> surface_factory_ozone_;
scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
scoped_ptr<InputMethodContextFactoryOzone>
input_method_context_factory_ozone_;
scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
base::FilePath file_path_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment