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

Side by Side Diff: ash/desktop_background/desktop_background_controller.cc

Issue 10184012: Revert 133468 - Fix wallpaper fade animation flashing problem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/desktop_background/desktop_background_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/desktop_background/desktop_background_controller.h" 5 #include "ash/desktop_background/desktop_background_controller.h"
6 6
7 #include "ash/desktop_background/desktop_background_view.h" 7 #include "ash/desktop_background/desktop_background_view.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_factory.h" 9 #include "ash/shell_factory.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 11 matching lines...) Expand all
22 DesktopBackgroundController::DesktopBackgroundController() : 22 DesktopBackgroundController::DesktopBackgroundController() :
23 desktop_background_mode_(BACKGROUND_IMAGE) { 23 desktop_background_mode_(BACKGROUND_IMAGE) {
24 } 24 }
25 25
26 DesktopBackgroundController::~DesktopBackgroundController() { 26 DesktopBackgroundController::~DesktopBackgroundController() {
27 } 27 }
28 28
29 void DesktopBackgroundController::SetDesktopBackgroundImageMode() { 29 void DesktopBackgroundController::SetDesktopBackgroundImageMode() {
30 internal::RootWindowLayoutManager* root_window_layout = 30 internal::RootWindowLayoutManager* root_window_layout =
31 Shell::GetInstance()->root_window_layout(); 31 Shell::GetInstance()->root_window_layout();
32 if (root_window_layout->background_widget())
33 root_window_layout->background_widget()->Hide();
32 int index = Shell::GetInstance()->user_wallpaper_delegate()-> 34 int index = Shell::GetInstance()->user_wallpaper_delegate()->
33 GetUserWallpaperIndex(); 35 GetUserWallpaperIndex();
34 root_window_layout->SetBackgroundLayer(NULL); 36 root_window_layout->SetBackgroundLayer(NULL);
35 internal::CreateDesktopBackground(GetWallpaper(index), 37 root_window_layout->SetBackgroundWidget(
36 GetWallpaperInfo(index).layout); 38 internal::CreateDesktopBackground(GetWallpaper(index),
39 GetWallpaperInfo(index).layout));
37 desktop_background_mode_ = BACKGROUND_IMAGE; 40 desktop_background_mode_ = BACKGROUND_IMAGE;
38 } 41 }
39 42
40 void DesktopBackgroundController::SetDesktopBackgroundSolidColorMode() { 43 void DesktopBackgroundController::SetDesktopBackgroundSolidColorMode() {
41 // Set a solid black background. 44 // Set a solid black background.
42 // TODO(derat): Remove this in favor of having the compositor only clear the 45 // TODO(derat): Remove this in favor of having the compositor only clear the
43 // viewport when there are regions not covered by a layer: 46 // viewport when there are regions not covered by a layer:
44 // http://crbug.com/113445 47 // http://crbug.com/113445
45 Shell* shell = Shell::GetInstance(); 48 Shell* shell = Shell::GetInstance();
46 ui::Layer* background_layer = new ui::Layer(ui::LAYER_SOLID_COLOR); 49 ui::Layer* background_layer = new ui::Layer(ui::LAYER_SOLID_COLOR);
47 background_layer->SetColor(SK_ColorBLACK); 50 background_layer->SetColor(SK_ColorBLACK);
48 shell->GetContainer(internal::kShellWindowId_DesktopBackgroundContainer)-> 51 shell->GetContainer(internal::kShellWindowId_DesktopBackgroundContainer)->
49 layer()->Add(background_layer); 52 layer()->Add(background_layer);
50 shell->root_window_layout()->SetBackgroundLayer(background_layer); 53 shell->root_window_layout()->SetBackgroundLayer(background_layer);
51 shell->root_window_layout()->SetBackgroundWidget(NULL); 54 shell->root_window_layout()->SetBackgroundWidget(NULL);
52 desktop_background_mode_ = BACKGROUND_SOLID_COLOR; 55 desktop_background_mode_ = BACKGROUND_SOLID_COLOR;
53 } 56 }
54 57
55 } // namespace ash 58 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/desktop_background/desktop_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698