Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: ash/shell.cc

Issue 9414028: Aura: New window shadows, desktop background debug toggle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index ac4a385032101c3618e505c396df38be4c6c47be..9cd3c5d4ffdee636bdfb98a989d5d9752c583dc3 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.
@@ -460,6 +461,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);
@@ -541,15 +563,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() {
@@ -597,8 +611,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) {
« no previous file with comments | « ash/shell.h ('k') | ash/shell/window_type_launcher.cc » ('j') | ash/wm/shadow.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698