Commit a148d276 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Remove unnecessary ash:: prefixes from //ash/frame

Bug: none
Change-Id: I685d189ce5b58e8eb699d8ecece4c8985053b737
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693767Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676200}
parent 66790f3c
......@@ -37,7 +37,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
bool CanMaximize() const override { return true; }
bool CanMinimize() const override { return true; }
ash::FrameCaptionButtonContainerView* caption_button_container() {
FrameCaptionButtonContainerView* caption_button_container() {
return caption_button_container_;
}
......@@ -75,7 +75,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
}
// Not owned.
ash::FrameCaptionButtonContainerView* caption_button_container_;
FrameCaptionButtonContainerView* caption_button_container_;
bool resizable_;
DISALLOW_COPY_AND_ASSIGN(TestWidgetDelegate);
......@@ -125,7 +125,7 @@ class FrameSizeButtonTest : public AshTestBase {
TestWidgetDelegate* delegate = new TestWidgetDelegate(resizable_);
window_state_ =
ash::wm::GetWindowState(CreateWidget(delegate)->GetNativeWindow());
wm::GetWindowState(CreateWidget(delegate)->GetNativeWindow());
FrameCaptionButtonContainerView::TestApi test(
delegate->caption_button_container());
......@@ -137,8 +137,8 @@ class FrameSizeButtonTest : public AshTestBase {
close_button_ = test.close_button();
}
ash::wm::WindowState* window_state() { return window_state_; }
const ash::wm::WindowState* window_state() const { return window_state_; }
wm::WindowState* window_state() { return window_state_; }
const wm::WindowState* window_state() const { return window_state_; }
views::FrameCaptionButton* minimize_button() { return minimize_button_; }
views::FrameCaptionButton* size_button() { return size_button_; }
......@@ -146,7 +146,7 @@ class FrameSizeButtonTest : public AshTestBase {
private:
// Not owned.
ash::wm::WindowState* window_state_;
wm::WindowState* window_state_;
views::FrameCaptionButton* minimize_button_;
views::FrameCaptionButton* size_button_;
views::FrameCaptionButton* close_button_;
......
......@@ -125,8 +125,7 @@ class NonClientFrameViewAshImmersiveHelper : public wm::WindowStateObserver,
ImmersiveFullscreenController::EnableForWidget(widget_, false);
if (window_state->IsFullscreen() &&
window_state->window()->GetProperty(
ash::kImmersiveImpliedByFullscreen)) {
window_state->window()->GetProperty(kImmersiveImpliedByFullscreen)) {
ImmersiveFullscreenController::EnableForWidget(widget_, true);
}
}
......@@ -282,8 +281,8 @@ void NonClientFrameViewAsh::InitImmersiveFullscreenControllerForView(
void NonClientFrameViewAsh::SetFrameColors(SkColor active_frame_color,
SkColor inactive_frame_color) {
aura::Window* frame_window = frame_->GetNativeWindow();
frame_window->SetProperty(ash::kFrameActiveColorKey, active_frame_color);
frame_window->SetProperty(ash::kFrameInactiveColorKey, inactive_frame_color);
frame_window->SetProperty(kFrameActiveColorKey, active_frame_color);
frame_window->SetProperty(kFrameInactiveColorKey, inactive_frame_color);
}
void NonClientFrameViewAsh::SetCaptionButtonModel(
......@@ -431,11 +430,11 @@ const views::View* NonClientFrameViewAsh::GetAvatarIconViewForTest() const {
}
SkColor NonClientFrameViewAsh::GetActiveFrameColorForTest() const {
return frame_->GetNativeWindow()->GetProperty(ash::kFrameActiveColorKey);
return frame_->GetNativeWindow()->GetProperty(kFrameActiveColorKey);
}
SkColor NonClientFrameViewAsh::GetInactiveFrameColorForTest() const {
return frame_->GetNativeWindow()->GetProperty(ash::kFrameInactiveColorKey);
return frame_->GetNativeWindow()->GetProperty(kFrameInactiveColorKey);
}
void NonClientFrameViewAsh::UpdateHeaderView() {
......
......@@ -373,7 +373,7 @@ TEST_F(NonClientFrameViewAshTest, GetPreferredOnScreenHeightInTabletMaximzied) {
auto* delegate = new TestWidgetConstraintsDelegate;
std::unique_ptr<views::Widget> widget = CreateTestWidget(delegate);
auto* frame_view = static_cast<ash::NonClientFrameViewAsh*>(
auto* frame_view = static_cast<NonClientFrameViewAsh*>(
widget->non_client_view()->frame_view());
auto* header_view = frame_view->GetHeaderView();
ASSERT_TRUE(widget->IsMaximized());
......@@ -485,7 +485,7 @@ TEST_F(NonClientFrameViewAshTest, HeaderVisibilityInFullscreen) {
// Turn immersive off, and make sure that header view is invisible
// in fullscreen.
widget->SetFullscreen(true);
ash::ImmersiveFullscreenController::EnableForWidget(widget.get(), false);
ImmersiveFullscreenController::EnableForWidget(widget.get(), false);
EXPECT_FALSE(header_view->in_immersive_mode());
EXPECT_FALSE(header_view->GetVisible());
widget->SetFullscreen(false);
......@@ -536,8 +536,8 @@ class TestButtonModel : public CaptionButtonModel {
} // namespace
TEST_F(NonClientFrameViewAshTest, BackButton) {
ash::AcceleratorControllerImpl* controller =
ash::Shell::Get()->accelerator_controller();
AcceleratorControllerImpl* controller =
Shell::Get()->accelerator_controller();
std::unique_ptr<TestButtonModel> model = std::make_unique<TestButtonModel>();
TestButtonModel* model_ptr = model.get();
......@@ -847,8 +847,8 @@ class TestWidgetDelegate : public TestWidgetConstraintsDelegate {
views::NonClientFrameView* CreateNonClientFrameView(
views::Widget* widget) override {
if (custom_) {
ash::wm::WindowState* window_state =
ash::wm::GetWindowState(widget->GetNativeWindow());
wm::WindowState* window_state =
wm::GetWindowState(widget->GetNativeWindow());
window_state->SetDelegate(std::make_unique<wm::WindowStateDelegate>());
}
return TestWidgetConstraintsDelegate::CreateNonClientFrameView(widget);
......@@ -863,19 +863,18 @@ class TestWidgetDelegate : public TestWidgetConstraintsDelegate {
} // namespace
// Verify that NonClientFrameViewAsh updates the active color based on the
// ash::kFrameActiveColorKey window property.
// kFrameActiveColorKey window property.
TEST_P(NonClientFrameViewAshFrameColorTest, kFrameActiveColorKey) {
TestWidgetDelegate* delegate = new TestWidgetDelegate(GetParam());
std::unique_ptr<views::Widget> widget = CreateTestWidget(delegate);
SkColor active_color =
widget->GetNativeWindow()->GetProperty(ash::kFrameActiveColorKey);
widget->GetNativeWindow()->GetProperty(kFrameActiveColorKey);
constexpr SkColor new_color = SK_ColorWHITE;
EXPECT_NE(active_color, new_color);
widget->GetNativeWindow()->SetProperty(ash::kFrameActiveColorKey, new_color);
active_color =
widget->GetNativeWindow()->GetProperty(ash::kFrameActiveColorKey);
widget->GetNativeWindow()->SetProperty(kFrameActiveColorKey, new_color);
active_color = widget->GetNativeWindow()->GetProperty(kFrameActiveColorKey);
EXPECT_EQ(active_color, new_color);
EXPECT_EQ(new_color,
delegate->non_client_frame_view()->GetActiveFrameColorForTest());
......@@ -887,47 +886,44 @@ TEST_P(NonClientFrameViewAshFrameColorTest, kFrameActiveColorKey) {
->caption_button_container());
ui::DrawWaiterForTest::WaitForCommit(widget->GetLayer()->GetCompositor());
gfx::ImageSkia original_icon_image = test_api.size_button()->icon_image();
widget->GetNativeWindow()->SetProperty(ash::kFrameActiveColorKey,
SK_ColorBLACK);
widget->GetNativeWindow()->SetProperty(kFrameActiveColorKey, SK_ColorBLACK);
ui::DrawWaiterForTest::WaitForCommit(widget->GetLayer()->GetCompositor());
EXPECT_FALSE(original_icon_image.BackedBySameObjectAs(
test_api.size_button()->icon_image()));
}
// Verify that NonClientFrameViewAsh updates the inactive color based on the
// ash::kFrameInactiveColorKey window property.
// kFrameInactiveColorKey window property.
TEST_P(NonClientFrameViewAshFrameColorTest, KFrameInactiveColor) {
TestWidgetDelegate* delegate = new TestWidgetDelegate(GetParam());
std::unique_ptr<views::Widget> widget = CreateTestWidget(delegate);
SkColor active_color =
widget->GetNativeWindow()->GetProperty(ash::kFrameInactiveColorKey);
widget->GetNativeWindow()->GetProperty(kFrameInactiveColorKey);
constexpr SkColor new_color = SK_ColorWHITE;
EXPECT_NE(active_color, new_color);
widget->GetNativeWindow()->SetProperty(ash::kFrameInactiveColorKey,
new_color);
active_color =
widget->GetNativeWindow()->GetProperty(ash::kFrameInactiveColorKey);
widget->GetNativeWindow()->SetProperty(kFrameInactiveColorKey, new_color);
active_color = widget->GetNativeWindow()->GetProperty(kFrameInactiveColorKey);
EXPECT_EQ(active_color, new_color);
EXPECT_EQ(new_color,
delegate->non_client_frame_view()->GetInactiveFrameColorForTest());
}
// Verify that NonClientFrameViewAsh updates the active color based on the
// ash::kFrameActiveColorKey window property.
// kFrameActiveColorKey window property.
TEST_P(NonClientFrameViewAshFrameColorTest, WideFrameInitialColor) {
TestWidgetDelegate* delegate = new TestWidgetDelegate(GetParam());
std::unique_ptr<views::Widget> widget = CreateTestWidget(delegate);
aura::Window* window = widget->GetNativeWindow();
SkColor active_color = window->GetProperty(ash::kFrameActiveColorKey);
SkColor inactive_color = window->GetProperty(ash::kFrameInactiveColorKey);
SkColor active_color = window->GetProperty(kFrameActiveColorKey);
SkColor inactive_color = window->GetProperty(kFrameInactiveColorKey);
constexpr SkColor new_active_color = SK_ColorWHITE;
constexpr SkColor new_inactive_color = SK_ColorBLACK;
EXPECT_NE(active_color, new_active_color);
EXPECT_NE(inactive_color, new_inactive_color);
window->SetProperty(ash::kFrameActiveColorKey, new_active_color);
window->SetProperty(ash::kFrameInactiveColorKey, new_inactive_color);
window->SetProperty(kFrameActiveColorKey, new_active_color);
window->SetProperty(kFrameInactiveColorKey, new_inactive_color);
std::unique_ptr<WideFrameView> wide_frame_view =
std::make_unique<WideFrameView>(widget.get());
......
......@@ -31,24 +31,23 @@ class ImmersiveFullscreenController;
// the target widget because ImmersiveFullscreenController is not owned by
// NonClientFrameViewAsh. Investigate if we integrate this into
// NonClientFrameViewAsh.
class ASH_EXPORT WideFrameView
: public views::WidgetDelegateView,
public aura::WindowObserver,
public display::DisplayObserver,
public ash::ImmersiveFullscreenControllerDelegate,
public OverviewObserver {
class ASH_EXPORT WideFrameView : public views::WidgetDelegateView,
public aura::WindowObserver,
public display::DisplayObserver,
public ImmersiveFullscreenControllerDelegate,
public OverviewObserver {
public:
explicit WideFrameView(views::Widget* target);
~WideFrameView() override;
// Initialize |immersive_fullscreen_controller| so that the controller reveals
// and |hides_header_| in immersive mode.
void Init(ash::ImmersiveFullscreenController* controller);
void Init(ImmersiveFullscreenController* controller);
// Set the caption model for caption buttions on this frame.
void SetCaptionButtonModel(std::unique_ptr<ash::CaptionButtonModel> mode);
void SetCaptionButtonModel(std::unique_ptr<CaptionButtonModel> mode);
ash::HeaderView* header_view() { return header_view_; }
HeaderView* header_view() { return header_view_; }
private:
static gfx::Rect GetFrameBounds(views::Widget* target);
......@@ -67,7 +66,7 @@ class ASH_EXPORT WideFrameView
void OnDisplayMetricsChanged(const display::Display& display,
uint32_t changed_metrics) override;
// ash::ImmersiveFullscreenControllerDelegate:
// ImmersiveFullscreenControllerDelegate:
void OnImmersiveRevealStarted() override;
void OnImmersiveRevealEnded() override;
void OnImmersiveFullscreenEntered() override;
......@@ -79,14 +78,14 @@ class ASH_EXPORT WideFrameView
void OnOverviewModeStarting() override;
void OnOverviewModeEnded() override;
ash::HeaderView* GetTargetHeaderView();
HeaderView* GetTargetHeaderView();
// The target widget this frame will control.
views::Widget* target_;
std::unique_ptr<views::Widget> widget_;
ash::HeaderView* header_view_ = nullptr;
HeaderView* header_view_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(WideFrameView);
};
......
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