Skip to content

Commit

Permalink
Revert "Don't show the shadow for maximized/fullscreen window"
Browse files Browse the repository at this point in the history
This reverts commit deecdaf.

BUG=
TBR=oshima@chromium.org,sky@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/797503006

Cr-Commit-Position: refs/heads/master@{#309288}
  • Loading branch information
reillyeon authored and Commit bot committed Dec 19, 2014
1 parent 16e83f5 commit 7f50639
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
11 changes: 1 addition & 10 deletions ui/wm/core/shadow_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
#include "base/logging.h"
#include "base/memory/linked_ptr.h"
#include "base/scoped_observer.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/env_observer.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
#include "ui/base/ui_base_types.h"
#include "ui/compositor/layer.h"
#include "ui/wm/core/shadow.h"
#include "ui/wm/core/shadow_types.h"
Expand Down Expand Up @@ -171,7 +169,7 @@ void ShadowController::Impl::OnWindowInitialized(aura::Window* window) {
void ShadowController::Impl::OnWindowPropertyChanged(aura::Window* window,
const void* key,
intptr_t old) {
if (key == kShadowTypeKey || key == aura::client::kShowStateKey) {
if (key == kShadowTypeKey) {
HandlePossibleShadowVisibilityChange(window);
return;
}
Expand Down Expand Up @@ -209,13 +207,6 @@ void ShadowController::Impl::OnWindowActivated(aura::Window* gained_active,

bool ShadowController::Impl::ShouldShowShadowForWindow(
aura::Window* window) const {
ui::WindowShowState show_state =
window->GetProperty(aura::client::kShowStateKey);
if (show_state == ui::SHOW_STATE_FULLSCREEN ||
show_state == ui::SHOW_STATE_MAXIMIZED) {
return SHADOW_TYPE_NONE;
}

const ShadowType type = GetShadowType(window);
switch (type) {
case SHADOW_TYPE_NONE:
Expand Down
25 changes: 0 additions & 25 deletions ui/wm/core/shadow_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <vector>

#include "base/memory/scoped_ptr.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/window.h"
Expand Down Expand Up @@ -155,30 +154,6 @@ TEST_F(ShadowControllerTest, ShadowStyle) {
EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow2->style());
}

// Tests that shadow gets updated when the window show state chagnes.
TEST_F(ShadowControllerTest, ShowState) {
ShadowController::TestApi api(shadow_controller());

scoped_ptr<aura::Window> window(new aura::Window(NULL));
window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
window->Init(aura::WINDOW_LAYER_TEXTURED);
ParentWindow(window.get());
window->Show();

Shadow* shadow = api.GetShadowForWindow(window.get());
ASSERT_TRUE(shadow != NULL);
EXPECT_EQ(Shadow::STYLE_INACTIVE, shadow->style());

window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
EXPECT_FALSE(shadow->layer()->visible());

window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
EXPECT_TRUE(shadow->layer()->visible());

window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
EXPECT_FALSE(shadow->layer()->visible());
}

// Tests that we use smaller shadows for tooltips and menus.
TEST_F(ShadowControllerTest, SmallShadowsForTooltipsAndMenus) {
ShadowController::TestApi api(shadow_controller());
Expand Down

0 comments on commit 7f50639

Please sign in to comment.