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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 10982035: Reland - cros: Add CHECK for screen unlock problem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check only ~ScreenLocker Created 8 years, 3 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/desktop_background/desktop_background_controller.cc
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index b1ca185291942bf418eeaac977a0979388459df5..6f4d11b4b3ee7a4c91d70a8fce14d0721aa08687 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -237,20 +237,20 @@ WallpaperResolution DesktopBackgroundController::GetAppropriateResolution() {
return resolution;
}
-void DesktopBackgroundController::MoveDesktopToLockedContainer() {
+bool DesktopBackgroundController::MoveDesktopToLockedContainer() {
if (locked_)
- return;
+ return false;
locked_ = true;
- ReparentBackgroundWidgets(GetBackgroundContainerId(false),
- GetBackgroundContainerId(true));
+ return ReparentBackgroundWidgets(GetBackgroundContainerId(false),
+ GetBackgroundContainerId(true));
}
-void DesktopBackgroundController::MoveDesktopToUnlockedContainer() {
+bool DesktopBackgroundController::MoveDesktopToUnlockedContainer() {
if (!locked_)
- return;
+ return false;
locked_ = false;
- ReparentBackgroundWidgets(GetBackgroundContainerId(true),
- GetBackgroundContainerId(false));
+ return ReparentBackgroundWidgets(GetBackgroundContainerId(true),
+ GetBackgroundContainerId(false));
}
void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) {
@@ -336,8 +336,9 @@ void DesktopBackgroundController::InstallComponentForAllWindows() {
}
}
-void DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
+bool DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
int dst_container) {
+ bool moved = false;
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
for (Shell::RootWindowList::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
@@ -352,11 +353,12 @@ void DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
GetComponent(false);
}
DCHECK(component);
- component->Reparent(root_window,
- src_container,
- dst_container);
+ moved = moved || component->Reparent(root_window,
+ src_container,
+ dst_container);
}
}
+ return moved;
}
int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
« no previous file with comments | « ash/desktop_background/desktop_background_controller.h ('k') | ash/desktop_background/desktop_background_widget_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698