summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 04:57:14 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 04:57:14 +0000
commit751444a62e18c4dc60c1443c37f97b444f475c81 (patch)
tree1a9613e72c1f121bf71d5c2a0bff40158d4ae3ba /ash
parent21729bcb4518c34d00a23d4fa984ea15eb19f3e2 (diff)
downloadchromium_src-751444a62e18c4dc60c1443c37f97b444f475c81.zip
chromium_src-751444a62e18c4dc60c1443c37f97b444f475c81.tar.gz
chromium_src-751444a62e18c4dc60c1443c37f97b444f475c81.tar.bz2
Restore tray background when locking screen.
BUG=121230 TEST=Move window to overlap ash shelf such that the shelf background is visible. Lock screen, system tray background should become visible when locked and invisible (to blend in with shelf) when unlocked. Review URL: http://codereview.chromium.org/9965070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/shelf_layout_manager.cc5
-rw-r--r--ash/wm/shelf_layout_manager.h8
2 files changed, 10 insertions, 3 deletions
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
index 0251f84..f010bfc 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -271,9 +271,11 @@ void ShelfLayoutManager::OnWindowPropertyChanged(aura::Window* window,
// ShelfLayoutManager, private:
void ShelfLayoutManager::SetState(VisibilityState visibility_state) {
+ ShellDelegate* delegate = Shell::GetInstance()->delegate();
State state;
state.visibility_state = visibility_state;
state.auto_hide_state = CalculateAutoHideState(visibility_state);
+ state.is_screen_locked = delegate && delegate->IsScreenLocked();
if (state_.Equals(state))
return; // Nothing changed.
@@ -383,7 +385,8 @@ void ShelfLayoutManager::UpdateShelfBackground(
}
bool ShelfLayoutManager::GetLauncherPaintsBackground() const {
- return window_overlaps_shelf_ || state_.visibility_state == AUTO_HIDE;
+ return (!state_.is_screen_locked && window_overlaps_shelf_) ||
+ state_.visibility_state == AUTO_HIDE;
}
void ShelfLayoutManager::UpdateAutoHideStateNow() {
diff --git a/ash/wm/shelf_layout_manager.h b/ash/wm/shelf_layout_manager.h
index 91d03e3..10988c4 100644
--- a/ash/wm/shelf_layout_manager.h
+++ b/ash/wm/shelf_layout_manager.h
@@ -150,7 +150,9 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
};
struct State {
- State() : visibility_state(VISIBLE), auto_hide_state(AUTO_HIDE_HIDDEN) {}
+ State() : visibility_state(VISIBLE),
+ auto_hide_state(AUTO_HIDE_HIDDEN),
+ is_screen_locked(false) {}
// Returns true if the two states are considered equal. As
// |auto_hide_state| only matters if |visibility_state| is |AUTO_HIDE|,
@@ -158,11 +160,13 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
bool Equals(const State& other) const {
return other.visibility_state == visibility_state &&
(visibility_state != AUTO_HIDE ||
- other.auto_hide_state == auto_hide_state);
+ other.auto_hide_state == auto_hide_state) &&
+ other.is_screen_locked == is_screen_locked;
}
VisibilityState visibility_state;
AutoHideState auto_hide_state;
+ bool is_screen_locked;
};
// Sets the visibility of the shelf to |state|.