diff options
author | Yukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 16:00:08 +0000 |
---|---|---|
committer | Yukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 16:00:08 +0000 |
commit | 749bf643e7d7f94df861c8b46e6b241ec92931dd (patch) | |
tree | 5a6238110e0cafc21806c686aca675cf018c36c3 | |
parent | 4a42bfa2a12341aa1e59b42822b9b887d261d10d (diff) | |
download | chromium_src-749bf643e7d7f94df861c8b46e6b241ec92931dd.zip chromium_src-749bf643e7d7f94df861c8b46e6b241ec92931dd.tar.gz chromium_src-749bf643e7d7f94df861c8b46e6b241ec92931dd.tar.bz2 |
Use platform-neutral initialize/shutdown functions for IME
This patch set replaces platform-specific initialize/shutdown
functions for IME with platform-neutral ones.
BUG=246534
Review URL: https://chromiumcodereview.appspot.com/16258007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205801 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/test/ash_test_base.cc | 6 | ||||
-rw-r--r-- | ash/test/ash_test_helper.cc | 6 | ||||
-rw-r--r-- | chrome/browser/notifications/desktop_notifications_unittest.cc | 11 | ||||
-rw-r--r-- | chrome/test/base/view_event_test_base.cc | 15 | ||||
-rw-r--r-- | content/browser/browser_main_runner.cc | 12 | ||||
-rw-r--r-- | ui/aura/test/aura_test_base.cc | 15 | ||||
-rw-r--r-- | ui/views/test/views_test_base.cc | 12 |
7 files changed, 22 insertions, 55 deletions
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 87f2243..f10d421 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -25,6 +25,7 @@ #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" +#include "ui/base/ime/input_method_initializer.h" #include "ui/gfx/display.h" #include "ui/gfx/point.h" #include "ui/gfx/screen.h" @@ -36,7 +37,6 @@ #include "base/win/windows_version.h" #include "ui/aura/remote_root_window_host_win.h" #include "ui/aura/root_window_host_win.h" -#include "ui/base/ime/win/tsf_bridge.h" #include "win8/test/test_registrar_constants.h" #endif @@ -102,9 +102,8 @@ void AshTestBase::SetUp() { switches::kAshHostWindowBounds, "1+1-800x600"); #if defined(OS_WIN) aura::test::SetUsePopupAsRootWindowForTest(true); - if (base::win::IsTSFAwareRequired()) - ui::TSFBridge::Initialize(); #endif + ui::InitializeInputMethodForTesting(); ash_test_helper_->SetUp(); @@ -152,6 +151,7 @@ void AshTestBase::TearDown() { ash_test_helper_->TearDown(); + ui::ShutdownInputMethodForTesting(); #if defined(OS_WIN) aura::test::SetUsePopupAsRootWindowForTest(false); // Kill the viewer process if we spun one up. diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 91ab017..17a3cc7 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc @@ -11,7 +11,7 @@ #include "ash/test/test_shell_delegate.h" #include "base/run_loop.h" #include "ui/aura/env.h" -#include "ui/base/ime/text_input_test_support.h" +#include "ui/base/ime/input_method_initializer.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/message_center/message_center.h" @@ -43,7 +43,7 @@ void AshTestHelper::SetUp() { // Disable animations during tests. zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); - ui::TextInputTestSupport::Initialize(); + ui::InitializeInputMethodForTesting(); // Creates Shell and hook with Desktop. test_shell_delegate_ = new TestShellDelegate; @@ -83,8 +83,8 @@ void AshTestHelper::TearDown() { #endif aura::Env::DeleteInstance(); - ui::TextInputTestSupport::Shutdown(); + ui::ShutdownInputMethodForTesting(); zero_duration_mode_.reset(); } diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc index f63610f..1eaaf82 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.cc +++ b/chrome/browser/notifications/desktop_notifications_unittest.cc @@ -15,6 +15,7 @@ #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" #include "content/public/common/show_desktop_notification_params.h" +#include "ui/base/ime/input_method_initializer.h" #include "ui/message_center/message_center.h" #if defined(USE_ASH) @@ -27,10 +28,6 @@ #include "ui/compositor/scoped_animation_duration_scale_mode.h" #endif -#if defined(OS_WIN) -#include "base/win/metro.h" -#include "ui/base/ime/win/tsf_bridge.h" -#endif using content::BrowserThread; @@ -105,10 +102,7 @@ DesktopNotificationsTest::~DesktopNotificationsTest() { } void DesktopNotificationsTest::SetUp() { -#if defined(OS_WIN) - if (base::win::IsTSFAwareRequired()) - ui::TSFBridge::Initialize(); -#endif + ui::InitializeInputMethodForTesting(); #if defined(USE_ASH) WebKit::initialize(webkit_platform_support_.Get()); ui::ScopedAnimationDurationScaleMode normal_duration_mode( @@ -144,6 +138,7 @@ void DesktopNotificationsTest::TearDown() { aura::Env::DeleteInstance(); WebKit::shutdown(); #endif + ui::ShutdownInputMethodForTesting(); } content::ShowDesktopNotificationHostMsgParams diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc index 1cb9769..f379c40 100644 --- a/chrome/test/base/view_event_test_base.cc +++ b/chrome/test/base/view_event_test_base.cc @@ -11,7 +11,7 @@ #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/browser_thread.h" -#include "ui/base/ime/text_input_test_support.h" +#include "ui/base/ime/input_method_initializer.h" #include "ui/base/test/ui_controls.h" #include "ui/message_center/message_center.h" #include "ui/views/view.h" @@ -30,11 +30,6 @@ #include "ui/aura/test/aura_test_helper.h" #endif -#if defined(OS_WIN) -#include "base/win/metro.h" -#include "ui/base/ime/win/tsf_bridge.h" -#endif - #if defined(OS_CHROMEOS) #include "chromeos/audio/cras_audio_handler.h" #include "chromeos/power/power_manager_handler.h" @@ -99,7 +94,7 @@ void ViewEventTestBase::Done() { } void ViewEventTestBase::SetUp() { - ui::TextInputTestSupport::Initialize(); + ui::InitializeInputMethodForTesting(); gfx::NativeView context = NULL; #if defined(USE_ASH) #if defined(OS_WIN) @@ -125,10 +120,6 @@ void ViewEventTestBase::SetUp() { aura_test_helper_->SetUp(); context = aura_test_helper_->root_window(); #endif -#if defined(OS_WIN) - if (base::win::IsTSFAwareRequired()) - ui::TSFBridge::Initialize(); -#endif window_ = views::Widget::CreateWindowWithContext(this, context); } @@ -158,7 +149,7 @@ void ViewEventTestBase::TearDown() { #elif defined(USE_AURA) aura_test_helper_->TearDown(); #endif - ui::TextInputTestSupport::Shutdown(); + ui::ShutdownInputMethodForTesting(); } bool ViewEventTestBase::CanResize() const { diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index 461f41b..9198d29 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc @@ -15,11 +15,11 @@ #include "content/browser/notification_service_impl.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" +#include "ui/base/ime/input_method_initializer.h" #if defined(OS_WIN) #include "base/win/metro.h" #include "base/win/windows_version.h" -#include "ui/base/ime/win/tsf_bridge.h" #include "ui/base/win/scoped_ole_initializer.h" #endif @@ -88,17 +88,14 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { // are NOT deleted. If you need something to run during WM_ENDSESSION add it // to browser_shutdown::Shutdown or BrowserProcess::EndSession. -#if defined(OS_WIN) -#if !defined(NO_TCMALLOC) +#if defined(OS_WIN) && !defined(NO_TCMALLOC) // When linking shared libraries, NO_TCMALLOC is defined, and dynamic // allocator selection is not supported. // Make this call before going multithreaded, or spawning any subprocesses. base::allocator::SetupSubprocessAllocator(); #endif - if (base::win::IsTSFAwareRequired()) - ui::TSFBridge::Initialize(); -#endif // OS_WIN + ui::InitializeInputMethod(); main_loop_->CreateThreads(); int result_code = main_loop_->GetResultCode(); @@ -125,9 +122,8 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { if (created_threads_) main_loop_->ShutdownThreadsAndCleanUp(); + ui::ShutdownInputMethod(); #if defined(OS_WIN) - if (base::win::IsTSFAwareRequired()) - ui::TSFBridge::Shutdown(); ole_initializer_.reset(NULL); #endif diff --git a/ui/aura/test/aura_test_base.cc b/ui/aura/test/aura_test_base.cc index 0e4a3ea..34d16a7 100644 --- a/ui/aura/test/aura_test_base.cc +++ b/ui/aura/test/aura_test_base.cc @@ -8,12 +8,7 @@ #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/base/gestures/gesture_configuration.h" -#include "ui/base/ime/text_input_test_support.h" - -#if defined(OS_WIN) -#include "base/win/metro.h" -#include "ui/base/ime/win/tsf_bridge.h" -#endif +#include "ui/base/ime/input_method_initializer.h" namespace aura { namespace test { @@ -33,7 +28,7 @@ AuraTestBase::~AuraTestBase() { void AuraTestBase::SetUp() { setup_called_ = true; testing::Test::SetUp(); - ui::TextInputTestSupport::Initialize(); + ui::InitializeInputMethodForTesting(); // Changing the parameters for gesture recognition shouldn't cause // tests to fail, so we use a separate set of parameters for unit @@ -71,10 +66,6 @@ void AuraTestBase::SetUp() { helper_.reset(new AuraTestHelper(&message_loop_)); helper_->SetUp(); -#if defined(OS_WIN) - if (base::win::IsTSFAwareRequired()) - ui::TSFBridge::Initialize(); -#endif } void AuraTestBase::TearDown() { @@ -85,7 +76,7 @@ void AuraTestBase::TearDown() { RunAllPendingInMessageLoop(); helper_->TearDown(); - ui::TextInputTestSupport::Shutdown(); + ui::ShutdownInputMethodForTesting(); testing::Test::TearDown(); } diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc index 1dea976..b83b82d 100644 --- a/ui/views/test/views_test_base.cc +++ b/ui/views/test/views_test_base.cc @@ -6,6 +6,7 @@ #include "base/run_loop.h" #include "ui/base/clipboard/clipboard.h" +#include "ui/base/ime/input_method_initializer.h" #if defined(USE_AURA) #include "ui/aura/env.h" @@ -13,11 +14,6 @@ #include "ui/aura/test/aura_test_helper.h" #endif -#if defined(OS_WIN) -#include "base/win/metro.h" -#include "ui/base/ime/win/tsf_bridge.h" -#endif - namespace views { ViewsTestBase::ViewsTestBase() @@ -41,10 +37,7 @@ void ViewsTestBase::SetUp() { aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); aura_test_helper_->SetUp(); #endif // USE_AURA -#if defined(OS_WIN) - if (base::win::IsTSFAwareRequired()) - ui::TSFBridge::Initialize(); -#endif + ui::InitializeInputMethodForTesting(); } void ViewsTestBase::TearDown() { @@ -56,6 +49,7 @@ void ViewsTestBase::TearDown() { teardown_called_ = true; views_delegate_.reset(); testing::Test::TearDown(); + ui::ShutdownInputMethodForTesting(); #if defined(USE_AURA) aura_test_helper_->TearDown(); #endif |