Commit 824466d2 authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Revert "Use the centralized TestKeyboardUI instead of ash-test-specific ones"

This reverts commit 02e508ce.

Reason for revert: compile failure

https://ci.chromium.org/buildbot/chromium.win/Win%20x64%20Builder%20(dbg)/62497

../../ui/keyboard/keyboard_test_util.cc(99,17):  error: 'keyboard::TestKeyboardUI::TestKeyboardUI' redeclared without 'dllimport' attribute: 'dllexport' attribute added [-Werror,-Winconsistent-dllimport]
TestKeyboardUI::TestKeyboardUI(ui::InputMethod* input_method)

Original change's description:
> Use the centralized TestKeyboardUI instead of ash-test-specific ones
> 
> This is mostly duplicate code.
> 
> Bug: 
> Change-Id: Id152dc65ef53eac65d40ef38b6b9da3f962ae9ba
> Reviewed-on: https://chromium-review.googlesource.com/832295
> Reviewed-by: Yuichiro Hanada <yhanada@chromium.org>
> Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
> Commit-Queue: Blake O'Hare <blakeo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#533168}

TBR=oshima@chromium.org,yhanada@chromium.org,blakeo@chromium.org

Change-Id: I0e7fedec0f8d5de8eb069bb2cd85f86009a4d55e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/895084Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533180}
parent e88a3fb5
......@@ -1228,8 +1228,6 @@ static_library("ash_shell_lib") {
"//ui/base",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/keyboard",
"//ui/keyboard:test_support",
"//ui/message_center",
"//ui/views",
"//ui/views:test_support",
......@@ -1753,6 +1751,8 @@ static_library("test_support_common") {
"highlighter/highlighter_controller_test_api.h",
"ime/test_ime_controller.cc",
"ime/test_ime_controller.h",
"keyboard/test_keyboard_ui.cc",
"keyboard/test_keyboard_ui.h",
"laser/laser_pointer_controller_test_api.cc",
"laser/laser_pointer_controller_test_api.h",
"lock_screen_action/lock_screen_action_background_controller_impl_test_api.h",
......@@ -1888,7 +1888,6 @@ static_library("test_support_common") {
"//ui/gl",
"//ui/gl:test_support",
"//ui/keyboard",
"//ui/keyboard:test_support",
"//ui/message_center",
"//ui/message_center/public/cpp",
"//ui/views",
......
// Copyright 2015 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/keyboard/test_keyboard_ui.h"
#include "ash/shell.h"
#include "ash/wm/window_util.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/mock_input_method.h"
namespace ash {
TestKeyboardUI::TestKeyboardUI() = default;
TestKeyboardUI::~TestKeyboardUI() = default;
bool TestKeyboardUI::HasContentsWindow() const {
return !!keyboard_;
}
bool TestKeyboardUI::ShouldWindowOverscroll(aura::Window* window) const {
return true;
}
aura::Window* TestKeyboardUI::GetContentsWindow() {
if (!keyboard_) {
keyboard_.reset(new aura::Window(&delegate_));
keyboard_->Init(ui::LAYER_NOT_DRAWN);
}
return keyboard_.get();
}
ui::InputMethod* TestKeyboardUI::GetInputMethod() {
aura::Window* active_window = wm::GetActiveWindow();
aura::Window* root_window = active_window ? active_window->GetRootWindow()
: Shell::GetPrimaryRootWindow();
return root_window->GetHost()->GetInputMethod();
}
void TestKeyboardUI::ReloadKeyboardIfNeeded() {}
void TestKeyboardUI::InitInsets(const gfx::Rect& keyboard_bounds) {}
void TestKeyboardUI::ResetInsets() {}
} // namespace ash
// Copyright 2015 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_KEYBOARD_TEST_KEYBOARD_UI_H_
#define ASH_KEYBOARD_TEST_KEYBOARD_UI_H_
#include <memory>
#include "base/macros.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/keyboard/keyboard_ui.h"
namespace aura {
class Window;
} // namespace aura
namespace ash {
// Stub implementation of keyboard::KeyboardUI
class TestKeyboardUI : public keyboard::KeyboardUI {
public:
TestKeyboardUI();
~TestKeyboardUI() override;
bool HasContentsWindow() const override;
bool ShouldWindowOverscroll(aura::Window* window) const override;
aura::Window* GetContentsWindow() override;
private:
// Overridden from keyboard::KeyboardUI:
ui::InputMethod* GetInputMethod() override;
void ReloadKeyboardIfNeeded() override;
void InitInsets(const gfx::Rect& keyboard_bounds) override;
void ResetInsets() override;
aura::test::TestWindowDelegate delegate_;
std::unique_ptr<aura::Window> keyboard_;
DISALLOW_COPY_AND_ASSIGN(TestKeyboardUI);
};
} // namespace ash
#endif // ASH_KEYBOARD_TEST_KEYBOARD_UI_H_
......@@ -8,6 +8,7 @@
#include "ash/accessibility/default_accessibility_delegate.h"
#include "ash/default_wallpaper_delegate.h"
#include "ash/keyboard/test_keyboard_ui.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
#include "ash/shelf/shelf.h"
......@@ -19,11 +20,8 @@
#include "base/strings/utf_string_conversions.h"
#include "components/user_manager/user_info_impl.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/keyboard/keyboard_test_util.h"
#include "ui/keyboard/keyboard_ui.h"
namespace ash {
namespace shell {
......@@ -53,8 +51,7 @@ void ShellDelegateImpl::PreInit() {}
void ShellDelegateImpl::PreShutdown() {}
std::unique_ptr<keyboard::KeyboardUI> ShellDelegateImpl::CreateKeyboardUI() {
return std::make_unique<keyboard::TestKeyboardUI>(
Shell::GetPrimaryRootWindow()->GetHost()->GetInputMethod());
return std::make_unique<TestKeyboardUI>();
}
void ShellDelegateImpl::OpenUrlFromArc(const GURL& url) {}
......
......@@ -5,14 +5,12 @@
#include "ash/test_shell_delegate.h"
#include "ash/accessibility/default_accessibility_delegate.h"
#include "ash/shell.h"
#include "ash/keyboard/test_keyboard_ui.h"
#include "ash/system/tray/system_tray_notifier.h"
#include "ash/test_screenshot_delegate.h"
#include "ash/wallpaper/test_wallpaper_delegate.h"
#include "base/logging.h"
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/image/image.h"
#include "ui/keyboard/keyboard_test_util.h"
namespace ash {
......@@ -41,8 +39,7 @@ void TestShellDelegate::PreInit() {}
void TestShellDelegate::PreShutdown() {}
std::unique_ptr<keyboard::KeyboardUI> TestShellDelegate::CreateKeyboardUI() {
return std::make_unique<keyboard::TestKeyboardUI>(
Shell::GetPrimaryRootWindow()->GetHost()->GetInputMethod());
return std::make_unique<TestKeyboardUI>();
}
void TestShellDelegate::OpenUrlFromArc(const GURL& url) {}
......
......@@ -9,7 +9,6 @@
#include "ui/aura/window.h"
#include "ui/base/ime/dummy_input_method.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_export.h"
#include "ui/keyboard/keyboard_ui.h"
namespace gfx {
......@@ -34,7 +33,7 @@ void WaitControllerStateChangesTo(const KeyboardControllerState state);
gfx::Rect KeyboardBoundsFromRootBounds(const gfx::Rect& root_bounds,
int keyboard_height);
class KEYBOARD_EXPORT TestKeyboardUI : public KeyboardUI {
class TestKeyboardUI : public KeyboardUI {
public:
TestKeyboardUI(ui::InputMethod* input_method);
~TestKeyboardUI() override;
......
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