Commit f81327e4 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

Fix elevation for assistive window

Both emoji and personal info suggestions require +2 elevation

Current View: http://screen/rnfGzOx97Nw
Emoji Specs: http://screen/qgE7xnf2LhN
Personal Info Specs: http://screen/nbDgNJ3gdRZ

Bug: 1099454
Change-Id: I6e7e8ed4ef0f91ed0ec1413430f9f5059bc918ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2281768
Commit-Queue: My Nguyen <myy@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785304}
parent ddb23eb4
......@@ -9,11 +9,13 @@
#include "chrome/browser/chromeos/input_method/assistive_window_controller_delegate.h"
#include "chrome/browser/chromeos/input_method/ui/suggestion_details.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/test/base/chrome_ash_test_base.h"
#include "chrome/test/base/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/window.h"
#include "ui/base/ime/chromeos/ime_bridge.h"
#include "ui/views/test/test_views_delegate.h"
#include "ui/wm/core/window_util.h"
namespace {
......@@ -61,6 +63,11 @@ class AssistiveWindowControllerTest : public ChromeAshTestBase {
ChromeAshTestBase::SetUp();
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(1));
wm::ActivateWindow(window.get());
// TODO(crbug/1102283): Create MockSuggestionWindowView to be independent of
// SuggestionWindowView's implementation.
static_cast<views::TestViewsDelegate*>(views::ViewsDelegate::GetInstance())
->set_layout_provider(ChromeLayoutProvider::CreateLayoutProvider());
}
std::vector<base::string16> Candidates() {
......
......@@ -4,6 +4,8 @@
#include "chrome/browser/chromeos/input_method/ui/border_factory.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
namespace ui {
namespace ime {
......@@ -18,6 +20,9 @@ std::unique_ptr<views::BubbleBorder> GetBorderForWindow(
border = std::make_unique<views::BubbleBorder>(
views::BubbleBorder::NONE, views::BubbleBorder::SMALL_SHADOW,
gfx::kPlaceholderColor);
border->set_md_shadow_elevation(
ChromeLayoutProvider::Get()->GetShadowElevationMetric(
views::EMPHASIS_MEDIUM));
}
border->SetCornerRadius(views::LayoutProvider::Get()->GetCornerRadiusMetric(
views::EmphasisMetric::EMPHASIS_MEDIUM));
......
......@@ -10,8 +10,8 @@
#include "chrome/browser/chromeos/input_method/assistive_window_properties.h"
#include "chrome/browser/chromeos/input_method/ui/assistive_delegate.h"
#include "chrome/browser/chromeos/input_method/ui/suggestion_view.h"
#include "chrome/test/views/chrome_views_test_base.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/views/test/views_test_base.h"
namespace ui {
namespace ime {
......@@ -23,14 +23,14 @@ class MockAssistiveDelegate : public AssistiveDelegate {
const ui::ime::AssistiveWindowButton& button) const override {}
};
class SuggestionWindowViewTest : public views::ViewsTestBase {
class SuggestionWindowViewTest : public ChromeViewsTestBase {
public:
SuggestionWindowViewTest() {}
~SuggestionWindowViewTest() override {}
protected:
void SetUp() override {
views::ViewsTestBase::SetUp();
ChromeViewsTestBase::SetUp();
InitCandidates();
window_.candidates = candidates_;
......@@ -44,7 +44,7 @@ class SuggestionWindowViewTest : public views::ViewsTestBase {
void TearDown() override {
suggestion_window_view_->GetWidget()->CloseNow();
views::ViewsTestBase::TearDown();
ChromeViewsTestBase::TearDown();
}
void InitCandidates() {
......
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