diff options
author | bshe <bshe@chromium.org> | 2014-09-16 13:46:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-16 20:46:51 +0000 |
commit | 9858b4ad01cf2220d18acdc8cb7cbae328974d33 (patch) | |
tree | 39fb2bae10360700923f5208f82d180ba31df680 | |
parent | a8362b117eb9f9e063d844a5e347357215f02bad (diff) | |
download | chromium_src-9858b4ad01cf2220d18acdc8cb7cbae328974d33.zip chromium_src-9858b4ad01cf2220d18acdc8cb7cbae328974d33.tar.gz chromium_src-9858b4ad01cf2220d18acdc8cb7cbae328974d33.tar.bz2 |
Remove keyboard usability mode
BUG=414766
Review URL: https://codereview.chromium.org/574033003
Cr-Commit-Position: refs/heads/master@{#295140}
-rw-r--r-- | ash/ash.gyp | 3 | ||||
-rw-r--r-- | ash/display/display_controller.cc | 11 | ||||
-rw-r--r-- | ash/display/display_controller.h | 7 | ||||
-rw-r--r-- | ash/display/display_manager.cc | 10 | ||||
-rw-r--r-- | ash/display/display_manager.h | 10 | ||||
-rw-r--r-- | ash/display/virtual_keyboard_window_controller.cc | 110 | ||||
-rw-r--r-- | ash/display/virtual_keyboard_window_controller.h | 63 | ||||
-rw-r--r-- | ash/display/virtual_keyboard_window_controller_unittest.cc | 59 | ||||
-rw-r--r-- | ash/root_window_controller.cc | 35 | ||||
-rw-r--r-- | ash/shell.cc | 13 | ||||
-rw-r--r-- | chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc | 10 | ||||
-rw-r--r-- | ui/keyboard/keyboard_controller.cc | 6 | ||||
-rw-r--r-- | ui/keyboard/keyboard_controller_unittest.cc | 35 | ||||
-rw-r--r-- | ui/keyboard/keyboard_switches.cc | 2 | ||||
-rw-r--r-- | ui/keyboard/keyboard_switches.h | 4 | ||||
-rw-r--r-- | ui/keyboard/keyboard_util.cc | 15 | ||||
-rw-r--r-- | ui/keyboard/keyboard_util.h | 3 |
17 files changed, 23 insertions, 373 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp index 0dd433c..851784f 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -102,8 +102,6 @@ 'display/screen_position_controller.h', 'display/shared_display_edge_indicator.cc', 'display/shared_display_edge_indicator.h', - 'display/virtual_keyboard_window_controller.cc', - 'display/virtual_keyboard_window_controller.h', 'drag_drop/drag_drop_controller.cc', 'drag_drop/drag_drop_controller.h', 'drag_drop/drag_drop_tracker.cc', @@ -775,7 +773,6 @@ 'display/display_info_unittest.cc', 'display/display_manager_unittest.cc', 'display/mirror_window_controller_unittest.cc', - 'display/virtual_keyboard_window_controller_unittest.cc', 'display/mouse_cursor_event_filter_unittest.cc', 'display/projecting_observer_chromeos_unittest.cc', 'display/resolution_notification_controller_unittest.cc', diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index 173b2b7..b126774 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -14,7 +14,6 @@ #include "ash/display/display_manager.h" #include "ash/display/mirror_window_controller.h" #include "ash/display/root_window_transformers.h" -#include "ash/display/virtual_keyboard_window_controller.h" #include "ash/host/ash_window_tree_host.h" #include "ash/host/ash_window_tree_host_init_params.h" #include "ash/host/root_window_transformer.h" @@ -251,8 +250,6 @@ DisplayController::~DisplayController() { void DisplayController::Start() { // Created here so that Shell has finished being created. Adds itself // as a ShellObserver. - virtual_keyboard_window_controller_.reset( - new VirtualKeyboardWindowController); Shell::GetScreen()->AddObserver(this); Shell::GetInstance()->display_manager()->set_delegate(this); } @@ -264,7 +261,6 @@ void DisplayController::Shutdown() { cursor_window_controller_.reset(); mirror_window_controller_.reset(); - virtual_keyboard_window_controller_.reset(); Shell::GetScreen()->RemoveObserver(this); @@ -666,12 +662,6 @@ void DisplayController::CreateOrUpdateNonDesktopDisplay( case DisplayManager::MIRRORING: mirror_window_controller_->UpdateWindow(info); cursor_window_controller_->UpdateContainer(); - virtual_keyboard_window_controller_->Close(); - break; - case DisplayManager::VIRTUAL_KEYBOARD: - mirror_window_controller_->Close(); - cursor_window_controller_->UpdateContainer(); - virtual_keyboard_window_controller_->UpdateWindow(info); break; case DisplayManager::EXTENDED: NOTREACHED(); @@ -681,7 +671,6 @@ void DisplayController::CreateOrUpdateNonDesktopDisplay( void DisplayController::CloseNonDesktopDisplay() { mirror_window_controller_->Close(); cursor_window_controller_->UpdateContainer(); - virtual_keyboard_window_controller_->Close(); } void DisplayController::PreDisplayConfigurationChange(bool clear_focus) { diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h index 988f138..a656d54 100644 --- a/ash/display/display_controller.h +++ b/ash/display/display_controller.h @@ -46,7 +46,6 @@ class DisplayManager; class FocusActivationStore; class MirrorWindowController; class RootWindowController; -class VirtualKeyboardWindowController; // DisplayController owns and maintains RootWindows for each attached // display, keeping them in sync with display configuration changes. @@ -90,10 +89,6 @@ class ASH_EXPORT DisplayController : public gfx::DisplayObserver, return mirror_window_controller_.get(); } - VirtualKeyboardWindowController* virtual_keyboard_window_controller() { - return virtual_keyboard_window_controller_.get(); - } - // Create a WindowTreeHost for the primary display. This replaces // |initial_bounds| in |init_params|. void CreatePrimaryHost(const AshWindowTreeHostInitParams& init_params); @@ -216,8 +211,6 @@ class ASH_EXPORT DisplayController : public gfx::DisplayObserver, scoped_ptr<CursorWindowController> cursor_window_controller_; scoped_ptr<MirrorWindowController> mirror_window_controller_; - scoped_ptr<VirtualKeyboardWindowController> - virtual_keyboard_window_controller_; // Stores the curent cursor location (in native coordinates) used to // restore the cursor location when display configuration diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc index 2769510d..e317e3b 100644 --- a/ash/display/display_manager.cc +++ b/ash/display/display_manager.cc @@ -435,12 +435,6 @@ void DisplayManager::SetDisplayRotation(int64 display_id, display_info_list.push_back(info); } AddMirrorDisplayInfoIfAny(&display_info_list); - if (virtual_keyboard_root_window_enabled() && - display_id == non_desktop_display_.id()) { - DisplayInfo info = GetDisplayInfo(display_id); - info.set_rotation(rotation); - display_info_list.push_back(info); - } UpdateDisplays(display_info_list); } @@ -1078,10 +1072,6 @@ void DisplayManager::ToggleDisplayScaleFactor() { #if defined(OS_CHROMEOS) void DisplayManager::SetSoftwareMirroring(bool enabled) { - // TODO(oshima|bshe): Support external display on the system - // that has virtual keyboard display. - if (second_display_mode_ == VIRTUAL_KEYBOARD) - return; SetSecondDisplayMode(enabled ? MIRRORING : EXTENDED); } diff --git a/ash/display/display_manager.h b/ash/display/display_manager.h index 545239f..0dc917a 100644 --- a/ash/display/display_manager.h +++ b/ash/display/display_manager.h @@ -70,13 +70,9 @@ class ASH_EXPORT DisplayManager // 1) EXTENDED mode extends the desktop to the second dislpay. // 2) MIRRORING mode copies the content of the primary display to // the 2nd display. (Software Mirroring). - // 3) In VIRTUAL_KEYBOARD mode, the 2nd display is used as a - // dedicated display for virtual keyboard, and it is not - // recognized as a part of desktop. enum SecondDisplayMode { EXTENDED, - MIRRORING, - VIRTUAL_KEYBOARD + MIRRORING }; // Returns the list of possible UI scales for the display. @@ -291,10 +287,6 @@ class ASH_EXPORT DisplayManager return second_display_mode_ == MIRRORING; }; - bool virtual_keyboard_root_window_enabled() const { - return second_display_mode_ == VIRTUAL_KEYBOARD; - }; - // Sets/gets second display mode. void SetSecondDisplayMode(SecondDisplayMode mode); SecondDisplayMode second_display_mode() const { diff --git a/ash/display/virtual_keyboard_window_controller.cc b/ash/display/virtual_keyboard_window_controller.cc deleted file mode 100644 index b75854a..0000000 --- a/ash/display/virtual_keyboard_window_controller.cc +++ /dev/null @@ -1,110 +0,0 @@ -// 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 "ash/display/virtual_keyboard_window_controller.h" - -#include "ash/display/display_controller.h" -#include "ash/display/display_info.h" -#include "ash/display/display_manager.h" -#include "ash/display/root_window_transformers.h" -#include "ash/host/ash_window_tree_host.h" -#include "ash/host/ash_window_tree_host_init_params.h" -#include "ash/host/root_window_transformer.h" -#include "ash/root_window_controller.h" -#include "ash/root_window_settings.h" -#include "ash/shell.h" -#include "ash/shell_window_ids.h" -#include "base/strings/stringprintf.h" -#include "base/strings/utf_string_conversions.h" -#include "ui/aura/env.h" -#include "ui/aura/window_event_dispatcher.h" -#include "ui/keyboard/keyboard_controller.h" -#include "ui/keyboard/keyboard_util.h" - -namespace ash { - -VirtualKeyboardWindowController::VirtualKeyboardWindowController() { - Shell::GetInstance()->AddShellObserver(this); -} - -VirtualKeyboardWindowController::~VirtualKeyboardWindowController() { - Shell::GetInstance()->RemoveShellObserver(this); - // Make sure the root window gets deleted before cursor_window_delegate. - Close(); -} - -void VirtualKeyboardWindowController::ActivateKeyboard( - keyboard::KeyboardController* keyboard_controller) { - root_window_controller_->ActivateKeyboard(keyboard_controller); -} - -void VirtualKeyboardWindowController::UpdateWindow( - const DisplayInfo& display_info) { - static int virtual_keyboard_host_count = 0; - if (!root_window_controller_.get()) { - AshWindowTreeHostInitParams init_params; - init_params.initial_bounds = display_info.bounds_in_native(); - AshWindowTreeHost* ash_host = AshWindowTreeHost::Create(init_params); - aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); - - host->window()->SetName(base::StringPrintf("VirtualKeyboardRootWindow-%d", - virtual_keyboard_host_count++)); - - // No need to remove WindowTreeHostObserver because the DisplayController - // outlives the host. - host->AddObserver(Shell::GetInstance()->display_controller()); - InitRootWindowSettings(host->window())->display_id = display_info.id(); - host->InitHost(); - RootWindowController::CreateForVirtualKeyboardDisplay(ash_host); - root_window_controller_.reset(GetRootWindowController(host->window())); - root_window_controller_->GetHost()->Show(); - root_window_controller_->ActivateKeyboard( - keyboard::KeyboardController::GetInstance()); - FlipDisplay(); - } else { - aura::WindowTreeHost* host = root_window_controller_->GetHost(); - GetRootWindowSettings(host->window())->display_id = display_info.id(); - host->SetBounds(display_info.bounds_in_native()); - } -} - -void VirtualKeyboardWindowController::Close() { - if (root_window_controller_.get()) { - root_window_controller_->GetHost()->RemoveObserver( - Shell::GetInstance()->display_controller()); - root_window_controller_->Shutdown(); - root_window_controller_.reset(); - } -} - -void VirtualKeyboardWindowController::FlipDisplay() { - DisplayManager* display_manager = Shell::GetInstance()->display_manager(); - if (!display_manager->virtual_keyboard_root_window_enabled()) { - NOTREACHED() << "Attempting to flip virtual keyboard root window when it " - << "is not enabled."; - return; - } - display_manager->SetDisplayRotation( - display_manager->non_desktop_display().id(), gfx::Display::ROTATE_180); - - aura::WindowTreeHost* host = root_window_controller_->GetHost(); - scoped_ptr<RootWindowTransformer> transformer( - CreateRootWindowTransformerForDisplay( - host->window(), display_manager->non_desktop_display())); - root_window_controller_->ash_host()->SetRootWindowTransformer( - transformer.Pass()); -} - -void VirtualKeyboardWindowController::OnMaximizeModeStarted() { - keyboard::SetTouchKeyboardEnabled(true); - Shell::GetInstance()->CreateKeyboard(); -} - -void VirtualKeyboardWindowController::OnMaximizeModeEnded() { - keyboard::SetTouchKeyboardEnabled(false); - if (!keyboard::IsKeyboardEnabled()) - Shell::GetInstance()->DeactivateKeyboard(); -} - -} // namespace ash diff --git a/ash/display/virtual_keyboard_window_controller.h b/ash/display/virtual_keyboard_window_controller.h deleted file mode 100644 index 23dd406..0000000 --- a/ash/display/virtual_keyboard_window_controller.h +++ /dev/null @@ -1,63 +0,0 @@ -// 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 ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ -#define ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ - -#include "ash/ash_export.h" -#include "ash/shell_observer.h" -#include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" -#include "ui/gfx/display.h" - -namespace keyboard { -class KeyboardController; -} - -namespace ash { -class DisplayInfo; -class RootWindowController; - -namespace test { -class VirtualKeyboardWindowControllerTest; -} // namespace test - -// This class maintains the RootWindowController dedicated for -// virtual keyboard. -class ASH_EXPORT VirtualKeyboardWindowController : public ShellObserver { - public: - VirtualKeyboardWindowController(); - virtual ~VirtualKeyboardWindowController(); - - void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller); - - // Updates the root window's bounds using |display_info|. - // Creates the new root window if one doesn't exist. - void UpdateWindow(const DisplayInfo& display_info); - - // Close the mirror window. - void Close(); - - // ShellObserver: - virtual void OnMaximizeModeStarted() OVERRIDE; - virtual void OnMaximizeModeEnded() OVERRIDE; - - private: - friend class test::VirtualKeyboardWindowControllerTest; - - // Rotates virtual keyboard display by 180 degrees. - void FlipDisplay(); - - RootWindowController* root_window_controller_for_test() { - return root_window_controller_.get(); - } - - scoped_ptr<RootWindowController> root_window_controller_; - - DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowController); -}; - -} // namespace ash - -#endif // ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ diff --git a/ash/display/virtual_keyboard_window_controller_unittest.cc b/ash/display/virtual_keyboard_window_controller_unittest.cc deleted file mode 100644 index 50f0573..0000000 --- a/ash/display/virtual_keyboard_window_controller_unittest.cc +++ /dev/null @@ -1,59 +0,0 @@ -// 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 "ash/display/virtual_keyboard_window_controller.h" - -#include "ash/ash_switches.h" -#include "ash/display/display_controller.h" -#include "ash/root_window_controller.h" -#include "ash/shell.h" -#include "ash/shell_window_ids.h" -#include "ash/test/ash_test_base.h" -#include "ash/wm/maximize_mode/maximize_mode_controller.h" -#include "base/command_line.h" -#include "ui/keyboard/keyboard_switches.h" -#include "ui/keyboard/keyboard_util.h" - -namespace ash { -namespace test { - -class VirtualKeyboardWindowControllerTest : public AshTestBase { - public: - VirtualKeyboardWindowControllerTest() - : virtual_keyboard_window_controller_(NULL) {} - virtual ~VirtualKeyboardWindowControllerTest() {} - - void set_virtual_keyboard_window_controller( - VirtualKeyboardWindowController* controller) { - virtual_keyboard_window_controller_ = controller; - } - - RootWindowController* root_window_controller() { - return virtual_keyboard_window_controller_-> - root_window_controller_for_test(); - } - - private: - VirtualKeyboardWindowController* virtual_keyboard_window_controller_; - DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowControllerTest); -}; - -// Tests that the onscreen keyboard becomes enabled when maximize mode is -// enabled. -TEST_F(VirtualKeyboardWindowControllerTest, EnabledDuringMaximizeMode) { - set_virtual_keyboard_window_controller( - Shell::GetInstance()->display_controller()-> - virtual_keyboard_window_controller()); - - ASSERT_FALSE(keyboard::IsKeyboardEnabled()); - Shell::GetInstance()->maximize_mode_controller()-> - EnableMaximizeModeWindowManager(true); - EXPECT_TRUE(keyboard::IsKeyboardEnabled()); - Shell::GetInstance()->maximize_mode_controller()-> - EnableMaximizeModeWindowManager(false); - EXPECT_FALSE(keyboard::IsKeyboardEnabled()); -} - -} // namespace test -} // namespace ash diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index eb97d25..6635af3 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -643,13 +643,11 @@ void RootWindowController::ActivateKeyboard( return; } DCHECK(keyboard_controller); - if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { - keyboard_controller->AddObserver(shelf()->shelf_layout_manager()); - keyboard_controller->AddObserver(panel_layout_manager_); - keyboard_controller->AddObserver(docked_layout_manager_); - keyboard_controller->AddObserver(workspace_controller_->layout_manager()); - Shell::GetInstance()->delegate()->VirtualKeyboardActivated(true); - } + keyboard_controller->AddObserver(shelf()->shelf_layout_manager()); + keyboard_controller->AddObserver(panel_layout_manager_); + keyboard_controller->AddObserver(docked_layout_manager_); + keyboard_controller->AddObserver(workspace_controller_->layout_manager()); + Shell::GetInstance()->delegate()->VirtualKeyboardActivated(true); aura::Window* parent = GetContainer( kShellWindowId_VirtualKeyboardParentContainer); DCHECK(parent); @@ -675,17 +673,15 @@ void RootWindowController::DeactivateKeyboard( kShellWindowId_VirtualKeyboardParentContainer); DCHECK(parent); parent->RemoveChild(keyboard_container); - if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { - // Virtual keyboard may be deactivated while still showing, notify all - // observers that keyboard bounds changed to 0 before remove them. - keyboard_controller->NotifyKeyboardBoundsChanging(gfx::Rect()); - keyboard_controller->RemoveObserver(shelf()->shelf_layout_manager()); - keyboard_controller->RemoveObserver(panel_layout_manager_); - keyboard_controller->RemoveObserver(docked_layout_manager_); - keyboard_controller->RemoveObserver( - workspace_controller_->layout_manager()); - Shell::GetInstance()->delegate()->VirtualKeyboardActivated(false); - } + // Virtual keyboard may be deactivated while still showing, notify all + // observers that keyboard bounds changed to 0 before remove them. + keyboard_controller->NotifyKeyboardBoundsChanging(gfx::Rect()); + keyboard_controller->RemoveObserver(shelf()->shelf_layout_manager()); + keyboard_controller->RemoveObserver(panel_layout_manager_); + keyboard_controller->RemoveObserver(docked_layout_manager_); + keyboard_controller->RemoveObserver( + workspace_controller_->layout_manager()); + Shell::GetInstance()->delegate()->VirtualKeyboardActivated(false); } } @@ -745,8 +741,7 @@ void RootWindowController::Init(RootWindowType root_window_type, if (root_window_type == PRIMARY) { root_window_layout()->OnWindowResized(); - if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) - shell->InitKeyboard(); + shell->InitKeyboard(); } else { root_window_layout()->OnWindowResized(); ash_host_->AsWindowTreeHost()->Show(); diff --git a/ash/shell.cc b/ash/shell.cc index 64ebb4a..9f8272f 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -23,7 +23,6 @@ #include "ash/display/event_transformation_handler.h" #include "ash/display/mouse_cursor_event_filter.h" #include "ash/display/screen_position_controller.h" -#include "ash/display/virtual_keyboard_window_controller.h" #include "ash/drag_drop/drag_drop_controller.h" #include "ash/first_run/first_run_helper_impl.h" #include "ash/focus_cycler.h" @@ -452,13 +451,8 @@ void Shell::CreateKeyboard() { // TODO(bshe): Primary root window controller may not be the controller to // attach virtual keyboard. See http://crbug.com/303429 InitKeyboard(); - if (keyboard::IsKeyboardUsabilityExperimentEnabled()) { - display_controller()->virtual_keyboard_window_controller()-> - ActivateKeyboard(keyboard::KeyboardController::GetInstance()); - } else { - GetPrimaryRootWindowController()-> - ActivateKeyboard(keyboard::KeyboardController::GetInstance()); - } + GetPrimaryRootWindowController()-> + ActivateKeyboard(keyboard::KeyboardController::GetInstance()); } void Shell::DeactivateKeyboard() { @@ -829,9 +823,6 @@ Shell::~Shell() { void Shell::Init(const ShellInitParams& init_params) { delegate_->PreInit(); - if (keyboard::IsKeyboardUsabilityExperimentEnabled()) { - display_manager_->SetSecondDisplayMode(DisplayManager::VIRTUAL_KEYBOARD); - } bool display_initialized = display_manager_->InitFromCommandLine(); #if defined(OS_CHROMEOS) display_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); diff --git a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc index f530490..85ba9a2 100644 --- a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc @@ -19,7 +19,6 @@ #include "ui/gfx/screen_type_delegate.h" #include "ui/keyboard/keyboard.h" #include "ui/keyboard/keyboard_controller.h" -#include "ui/keyboard/keyboard_util.h" #if defined(OS_CHROMEOS) #include "chrome/browser/ui/views/select_file_dialog_extension.h" @@ -107,12 +106,9 @@ void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { // Initialize TabScrubber after the Ash Shell has been initialized. TabScrubber::GetInstance(); // Activate virtual keyboard after profile is initialized. It depends on the - // default profile. If keyboard usability experiment flag is set, defer the - // activation to UpdateWindow() in virtual_keyboard_window_controller.cc. - if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { - ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( - keyboard::KeyboardController::GetInstance()); - } + // default profile. + ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( + keyboard::KeyboardController::GetInstance()); } void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc index 90bddb1..f8ab500 100644 --- a/ui/keyboard/keyboard_controller.cc +++ b/ui/keyboard/keyboard_controller.cc @@ -26,7 +26,6 @@ #include "ui/keyboard/keyboard_controller_observer.h" #include "ui/keyboard/keyboard_controller_proxy.h" #include "ui/keyboard/keyboard_layout_manager.h" -#include "ui/keyboard/keyboard_switches.h" #include "ui/keyboard/keyboard_util.h" #include "ui/wm/core/masked_window_targeter.h" @@ -408,11 +407,6 @@ void KeyboardController::OnTextInputStateChanged( if (!container_.get()) return; - if (IsKeyboardUsabilityExperimentEnabled()) { - ShowKeyboardInternal(); - return; - } - type_ = client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; if (type_ == ui::TEXT_INPUT_TYPE_NONE && !lock_keyboard_) { diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc index 39341d9..9688a2f 100644 --- a/ui/keyboard/keyboard_controller_unittest.cc +++ b/ui/keyboard/keyboard_controller_unittest.cc @@ -30,7 +30,6 @@ #include "ui/gfx/geometry/rect.h" #include "ui/keyboard/keyboard_controller_observer.h" #include "ui/keyboard/keyboard_controller_proxy.h" -#include "ui/keyboard/keyboard_switches.h" #include "ui/keyboard/keyboard_util.h" #include "ui/wm/core/default_activation_client.h" @@ -572,38 +571,4 @@ TEST_F(KeyboardControllerAnimationTest, ContainerShowWhileHide) { EXPECT_EQ(gfx::Transform(), layer->transform()); } -class KeyboardControllerUsabilityTest : public KeyboardControllerTest { - public: - KeyboardControllerUsabilityTest() {} - virtual ~KeyboardControllerUsabilityTest() {} - - virtual void SetUp() OVERRIDE { - CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kKeyboardUsabilityExperiment); - KeyboardControllerTest::SetUp(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(KeyboardControllerUsabilityTest); -}; - -TEST_F(KeyboardControllerUsabilityTest, KeyboardAlwaysVisibleInUsabilityTest) { - const gfx::Rect& root_bounds = root_window()->bounds(); - - ui::DummyTextInputClient input_client(ui::TEXT_INPUT_TYPE_TEXT); - ui::DummyTextInputClient no_input_client(ui::TEXT_INPUT_TYPE_NONE); - - aura::Window* keyboard_container(controller()->GetContainerWindow()); - keyboard_container->SetBounds(root_bounds); - root_window()->AddChild(keyboard_container); - - SetFocus(&input_client); - EXPECT_TRUE(keyboard_container->IsVisible()); - - SetFocus(&no_input_client); - // Keyboard should not hide itself after lost focus. - EXPECT_TRUE(keyboard_container->IsVisible()); - EXPECT_FALSE(WillHideKeyboard()); -} - } // namespace keyboard diff --git a/ui/keyboard/keyboard_switches.cc b/ui/keyboard/keyboard_switches.cc index c0f9bc5..0ff836c 100644 --- a/ui/keyboard/keyboard_switches.cc +++ b/ui/keyboard/keyboard_switches.cc @@ -21,7 +21,5 @@ const char kDisableVirtualKeyboardOverscroll[] = const char kEnableVirtualKeyboardOverscroll[] = "enable-virtual-keyboard-overscroll"; -const char kKeyboardUsabilityExperiment[] = "keyboard-usability-experiment"; - } // namespace switches } // namespace keyboard diff --git a/ui/keyboard/keyboard_switches.h b/ui/keyboard/keyboard_switches.h index 46b4010..013753a 100644 --- a/ui/keyboard/keyboard_switches.h +++ b/ui/keyboard/keyboard_switches.h @@ -36,10 +36,6 @@ KEYBOARD_EXPORT extern const char kDisableVirtualKeyboardOverscroll[]; // to provide access to content that would otherwise be occluded. KEYBOARD_EXPORT extern const char kEnableVirtualKeyboardOverscroll[]; -// Enables the keyboard usability experiment. This is an experimental mode for -// testing the usability of various experimental keyboard layouts. -KEYBOARD_EXPORT extern const char kKeyboardUsabilityExperiment[]; - } // namespace switches } // namespace keyboard diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc index 188aa73..ec305cf 100644 --- a/ui/keyboard/keyboard_util.cc +++ b/ui/keyboard/keyboard_util.cc @@ -59,13 +59,8 @@ gfx::Rect DefaultKeyboardBoundsFromWindowBounds( // Initialize default keyboard height to 0. The keyboard window height should // only be set by window.resizeTo in virtual keyboard web contents. Otherwise, // the default height may conflict with the new height and causing some - // strange animation issues. For keyboard usability experiments, a full screen - // virtual keyboard window is always preferred. - int keyboard_height = - keyboard::IsKeyboardUsabilityExperimentEnabled() ? - window_bounds.height() : 0; - - return KeyboardBoundsFromWindowBounds(window_bounds, keyboard_height); + // strange animation issues. + return KeyboardBoundsFromWindowBounds(window_bounds, 0); } gfx::Rect KeyboardBoundsFromWindowBounds(const gfx::Rect& window_bounds, @@ -109,16 +104,10 @@ bool IsKeyboardEnabled() { // Check if any of the flags are enabled. return CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableVirtualKeyboard) || - IsKeyboardUsabilityExperimentEnabled() || g_touch_keyboard_enabled || (g_keyboard_show_override == keyboard::KEYBOARD_SHOW_OVERRIDE_ENABLED); } -bool IsKeyboardUsabilityExperimentEnabled() { - return CommandLine::ForCurrentProcess()->HasSwitch( - switches::kKeyboardUsabilityExperiment); -} - bool IsKeyboardOverscrollEnabled() { if (!IsKeyboardEnabled()) return false; diff --git a/ui/keyboard/keyboard_util.h b/ui/keyboard/keyboard_util.h index 59b2b24..d8ad932 100644 --- a/ui/keyboard/keyboard_util.h +++ b/ui/keyboard/keyboard_util.h @@ -79,9 +79,6 @@ KEYBOARD_EXPORT std::string GetKeyboardLayout(); // Returns true if the virtual keyboard is enabled. KEYBOARD_EXPORT bool IsKeyboardEnabled(); -// Returns true if the keyboard usability test is enabled. -KEYBOARD_EXPORT bool IsKeyboardUsabilityExperimentEnabled(); - // Returns true if keyboard overscroll mode is enabled. KEYBOARD_EXPORT bool IsKeyboardOverscrollEnabled(); |