Commit c9ecec13 authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Views Cleanup: Removed View::visible() and View::enabled() and fixed up some references.

Follow-up to https://crrev.com/c/1610082

TBR=pkasting@chromium.org
TBR=reveman@chromium.org
TBR=halliwell@chromium.org

Change-Id: I9bf6e68a776143e4aa56943dc8768a778c4ab078
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611863
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660076}
parent a038ba5c
......@@ -70,7 +70,7 @@ class ExtensionsMenuViewBrowserTest : public DialogBrowserTest {
std::vector<ToolbarActionView*> GetVisibleToolbarActionViews() const {
auto views = GetToolbarActionViews();
base::EraseIf(views, [](views::View* view) { return !view->visible(); });
base::EraseIf(views, [](views::View* view) { return !view->GetVisible(); });
return views;
}
......
......@@ -40,8 +40,8 @@ TEST_F(CastViewsTest, ProgressBar) {
EXPECT_TRUE(progress_bar->GetWidget());
EXPECT_TRUE(progress_bar->GetWidget()->IsVisible());
EXPECT_TRUE(progress_bar->visible());
EXPECT_TRUE(progress_bar->enabled());
EXPECT_TRUE(progress_bar->GetVisible());
EXPECT_TRUE(progress_bar->GetEnabled());
widget.reset();
window_manager.reset();
......
......@@ -502,7 +502,7 @@ TEST_F(ClientControlledShellSurfaceTest, Frame) {
widget->non_client_view()->frame_view());
// Normal state.
EXPECT_TRUE(frame_view->visible());
EXPECT_TRUE(frame_view->GetVisible());
EXPECT_EQ(normal_window_bounds, widget->GetWindowBoundsInScreen());
EXPECT_EQ(client_bounds,
frame_view->GetClientBoundsForWindowBounds(normal_window_bounds));
......@@ -512,7 +512,7 @@ TEST_F(ClientControlledShellSurfaceTest, Frame) {
shell_surface->SetGeometry(fullscreen_bounds);
surface->Commit();
EXPECT_TRUE(frame_view->visible());
EXPECT_TRUE(frame_view->GetVisible());
EXPECT_EQ(fullscreen_bounds, widget->GetWindowBoundsInScreen());
EXPECT_EQ(
gfx::Size(800, 468),
......@@ -521,7 +521,7 @@ TEST_F(ClientControlledShellSurfaceTest, Frame) {
// AutoHide
surface->SetFrame(SurfaceFrameType::AUTOHIDE);
surface->Commit();
EXPECT_TRUE(frame_view->visible());
EXPECT_TRUE(frame_view->GetVisible());
EXPECT_EQ(fullscreen_bounds, widget->GetWindowBoundsInScreen());
EXPECT_EQ(fullscreen_bounds,
frame_view->GetClientBoundsForWindowBounds(fullscreen_bounds));
......@@ -529,7 +529,7 @@ TEST_F(ClientControlledShellSurfaceTest, Frame) {
// Fullscreen state.
shell_surface->SetFullscreen(true);
surface->Commit();
EXPECT_TRUE(frame_view->visible());
EXPECT_TRUE(frame_view->GetVisible());
EXPECT_EQ(fullscreen_bounds, widget->GetWindowBoundsInScreen());
EXPECT_EQ(fullscreen_bounds,
frame_view->GetClientBoundsForWindowBounds(fullscreen_bounds));
......@@ -539,7 +539,7 @@ TEST_F(ClientControlledShellSurfaceTest, Frame) {
shell_surface->SetGeometry(client_bounds);
surface->SetFrame(SurfaceFrameType::NORMAL);
surface->Commit();
EXPECT_TRUE(frame_view->visible());
EXPECT_TRUE(frame_view->GetVisible());
EXPECT_EQ(normal_window_bounds, widget->GetWindowBoundsInScreen());
EXPECT_EQ(client_bounds,
frame_view->GetClientBoundsForWindowBounds(normal_window_bounds));
......@@ -549,7 +549,7 @@ TEST_F(ClientControlledShellSurfaceTest, Frame) {
shell_surface->SetGeometry(client_bounds);
surface->SetFrame(SurfaceFrameType::NONE);
surface->Commit();
EXPECT_FALSE(frame_view->visible());
EXPECT_FALSE(frame_view->GetVisible());
EXPECT_EQ(client_bounds, widget->GetWindowBoundsInScreen());
EXPECT_EQ(client_bounds,
frame_view->GetClientBoundsForWindowBounds(client_bounds));
......@@ -559,11 +559,11 @@ TEST_F(ClientControlledShellSurfaceTest, Frame) {
shell_surface->SetGeometry(fullscreen_bounds);
surface->SetFrame(SurfaceFrameType::AUTOHIDE);
surface->Commit();
EXPECT_TRUE(frame_view->visible());
EXPECT_TRUE(frame_view->GetVisible());
EXPECT_TRUE(frame_view->GetHeaderView()->in_immersive_mode());
surface->SetFrame(SurfaceFrameType::NONE);
surface->Commit();
EXPECT_FALSE(frame_view->visible());
EXPECT_FALSE(frame_view->GetVisible());
EXPECT_FALSE(frame_view->GetHeaderView()->in_immersive_mode());
}
......@@ -1854,7 +1854,7 @@ TEST_F(ClientControlledShellSurfaceTest, SnappedInTabletMode) {
shell_surface->GetWidget()->non_client_view()->frame_view());
// Snapped window can also use auto hide.
surface->SetFrame(SurfaceFrameType::AUTOHIDE);
EXPECT_TRUE(frame_view->visible());
EXPECT_TRUE(frame_view->GetVisible());
EXPECT_TRUE(frame_view->GetHeaderView()->in_immersive_mode());
}
......
......@@ -197,7 +197,7 @@ void FullscreenShellSurface::OnWindowDestroying(aura::Window* window) {
void FullscreenShellSurface::CreateFullscreenShellSurfaceWidget(
ui::WindowShowState show_state) {
DCHECK(enabled());
DCHECK(GetEnabled());
DCHECK(!widget_);
views::Widget::InitParams params;
......@@ -237,7 +237,7 @@ void FullscreenShellSurface::CommitWidget() {
}
bool FullscreenShellSurface::OnPreWidgetCommit() {
if (!widget_ && enabled() && host_window()->bounds().IsEmpty())
if (!widget_ && GetEnabled() && host_window()->bounds().IsEmpty())
return false;
return true;
......
......@@ -556,10 +556,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
PropertyChangedSubscription AddVisibleChangedCallback(
PropertyChangedCallback callback) WARN_UNUSED_RESULT;
// NOTE: Deprecated. Please use GetVisible() which is the getter for the
// |Visible| property.
bool visible() const { return visible_; }
// Returns true if this view is drawn on screen.
virtual bool IsDrawn() const;
......@@ -578,10 +574,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
PropertyChangedSubscription AddEnabledChangedCallback(
PropertyChangedCallback callback) WARN_UNUSED_RESULT;
// NOTE: Deprecated. Please use GetEnabled() which is the getter for the
// |Enabled| property.
bool enabled() const { return enabled_; }
// Returns the child views ordered in reverse z-order. That is, views later in
// the returned vector have a higher z-order (are painted later) than those
// early in the vector. The returned vector has exactly the same number of
......
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