diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 23:05:54 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 23:05:54 +0000 |
commit | a8bd1cba75804f6d448acf0b5e4c91d0c4073c4b (patch) | |
tree | 63d3c722d19a3c873271576be3567d2aed60c8b0 /ash/shell.cc | |
parent | f7b1b2a21ea145f6c1042d51a62b751ba45c722e (diff) | |
download | chromium_src-a8bd1cba75804f6d448acf0b5e4c91d0c4073c4b.zip chromium_src-a8bd1cba75804f6d448acf0b5e4c91d0c4073c4b.tar.gz chromium_src-a8bd1cba75804f6d448acf0b5e4c91d0c4073c4b.tar.bz2 |
Aura: New window shadows, desktop background debug toggle
+ Shadows support different appearances for active and inactive states.
+ Shadow opacity animates on activation change.
+ ImageGrid supports changing its images, allowing us to maintain our use of a single set of shadow layers per window.
+ Press control-alt-B in a debug build to reset the desktop background to a solid color, useful with a white background for testing shadows.
+ Window shadow art assets were added in an earlier revision.
After this change lands I will delete the previous art assets, ui/resources/aura/shadow_rect_*
BUG=113075
TEST=aura_shell_unittests, added to ShadowControllerTest and ImageGridTest
TBR=sky@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=122547
Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=122551
Review URL: http://codereview.chromium.org/9414028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122618 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell.cc')
-rw-r--r-- | ash/shell.cc | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index 397a776..2e7630f 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -215,6 +215,7 @@ Shell::Shell(ShellDelegate* delegate) shelf_(NULL), dynamic_window_mode_(false), window_mode_(MODE_OVERLAPPING), + desktop_background_mode_(BACKGROUND_IMAGE), root_window_layout_(NULL), status_widget_(NULL) { // Pass ownership of the filter to the root window. @@ -467,6 +468,27 @@ void Shell::SetWindowModeForMonitorSize(const gfx::Size& monitor_size) { ChangeWindowMode(new_mode); } +void Shell::SetDesktopBackgroundMode(BackgroundMode mode) { + if (mode == BACKGROUND_SOLID_COLOR) { + // Set a solid black background. + // TODO(derat): Remove this in favor of having the compositor only clear the + // viewport when there are regions not covered by a layer: + // http://crbug.com/113445 + ui::Layer* background_layer = new ui::Layer(ui::Layer::LAYER_SOLID_COLOR); + background_layer->SetColor(SK_ColorBLACK); + GetContainer(internal::kShellWindowId_DesktopBackgroundContainer)-> + layer()->Add(background_layer); + root_window_layout_->SetBackgroundLayer(background_layer); + root_window_layout_->SetBackgroundWidget(NULL); + } else { + // Create the desktop background image. + root_window_layout_->SetBackgroundLayer(NULL); + root_window_layout_->SetBackgroundWidget( + internal::CreateDesktopBackground()); + } + desktop_background_mode_ = mode; +} + bool Shell::IsScreenLocked() const { const aura::Window* lock_screen_container = GetContainer( internal::kShellWindowId_LockScreenContainer); @@ -547,15 +569,7 @@ void Shell::SetupCompactWindowMode() { MaximizeWindows(default_container); // Set a solid black background. - // TODO(derat): Remove this in favor of having the compositor only clear the - // viewport when there are regions not covered by a layer: - // http://crbug.com/113445 - ui::Layer* background_layer = new ui::Layer(ui::Layer::LAYER_SOLID_COLOR); - background_layer->SetColor(SK_ColorBLACK); - GetContainer(internal::kShellWindowId_DesktopBackgroundContainer)-> - layer()->Add(background_layer); - root_window_layout_->SetBackgroundLayer(background_layer); - root_window_layout_->SetBackgroundWidget(NULL); + SetDesktopBackgroundMode(BACKGROUND_SOLID_COLOR); } void Shell::SetupNonCompactWindowMode() { @@ -603,8 +617,7 @@ void Shell::SetupNonCompactWindowMode() { RestoreMaximizedWindows(default_container); // Create the desktop background image. - root_window_layout_->SetBackgroundWidget(internal::CreateDesktopBackground()); - root_window_layout_->SetBackgroundLayer(NULL); + SetDesktopBackgroundMode(BACKGROUND_IMAGE); } void Shell::ResetLayoutManager(int container_id) { |