[go: nahoru, domu]

[ash-chrome] Remove unnecessary/dead code

This was added to keep the screen white during trasition from
boot slpash screen (which was white) to login page. Splash screen
is now black and the graphics system start with black screen,
so this no longer makes sense. (and probably we should have different
mechanism to specify the default startup color if necessary)

Bug: None
Change-Id: I45ef62f7ce21aa37fbd1fd29249b9ea99a6cc041
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5296777
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1260688}
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index 528e71e..f4a7104e 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -2772,8 +2772,6 @@
     "wm/system_modal_container_event_filter_delegate.h",
     "wm/system_modal_container_layout_manager.cc",
     "wm/system_modal_container_layout_manager.h",
-    "wm/system_wallpaper_controller.cc",
-    "wm/system_wallpaper_controller.h",
     "wm/tablet_mode/internal_input_devices_event_blocker.cc",
     "wm/tablet_mode/internal_input_devices_event_blocker.h",
     "wm/tablet_mode/scoped_skip_user_session_blocked_check.cc",
diff --git a/ash/constants/ash_constants.h b/ash/constants/ash_constants.h
index bb1f0a3..ea3e1de 100644
--- a/ash/constants/ash_constants.h
+++ b/ash/constants/ash_constants.h
@@ -21,9 +21,6 @@
 COMPONENT_EXPORT(ASH_CONSTANTS)
 extern const base::FilePath::CharType kNssKeyDbPath[];
 
-// Background color used for the Chrome OS boot splash screen.
-constexpr SkColor kChromeOsBootColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);
-
 // The border thickness of keyboard focus for launcher items and system tray.
 constexpr int kFocusBorderThickness = 2;
 
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 4c18dd6..0e25110 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -70,7 +70,6 @@
 #include "ash/wm/splitview/split_view_utils.h"
 #include "ash/wm/switchable_windows.h"
 #include "ash/wm/system_modal_container_layout_manager.h"
-#include "ash/wm/system_wallpaper_controller.h"
 #include "ash/wm/window_parenting_controller.h"
 #include "ash/wm/window_properties.h"
 #include "ash/wm/window_state.h"
@@ -722,7 +721,6 @@
     ash_host_->PrepareForShutdown();
   }
   window_parenting_controller_.reset();
-  system_wallpaper_.reset();
   security_curtain_widget_controller_.reset();
   lock_screen_action_background_controller_.reset();
   aura::client::SetScreenPositionClient(root_window, nullptr);
@@ -1088,7 +1086,6 @@
   root_window_layout_manager_ = root_window_layout_manager.get();
 
   CreateContainers();
-  CreateSystemWallpaper(root_window_type);
 
   InitLayoutManagers(std::move(root_window_layout_manager));
   InitTouchHuds();
@@ -1471,23 +1468,6 @@
   return window;
 }
 
-void RootWindowController::CreateSystemWallpaper(
-    RootWindowType root_window_type) {
-  SkColor color = SK_ColorBLACK;
-  // The splash screen appears on the primary display at boot. If this is a
-  // secondary monitor (either connected at boot or connected later) or if the
-  // browser restarted for a second login then don't use the boot color.
-  const bool is_boot_splash_screen =
-      root_window_type == RootWindowType::PRIMARY &&
-      base::CommandLine::ForCurrentProcess()->HasSwitch(
-          switches::kFirstExecAfterBoot);
-  if (is_boot_splash_screen) {
-    color = kChromeOsBootColor;
-  }
-  system_wallpaper_ =
-      std::make_unique<SystemWallpaperController>(GetRootWindow(), color);
-}
-
 AccessibilityPanelLayoutManager*
 RootWindowController::GetAccessibilityPanelLayoutManager() const {
   aura::Window* container = const_cast<aura::Window*>(
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h
index d7ded08..bddc854 100644
--- a/ash/root_window_controller.h
+++ b/ash/root_window_controller.h
@@ -54,7 +54,6 @@
 class SplitViewOverviewSession;
 class StatusAreaWidget;
 class SystemModalContainerLayoutManager;
-class SystemWallpaperController;
 class TouchExplorationManager;
 class TouchHudDebug;
 class TouchHudProjection;
@@ -301,11 +300,6 @@
                                 const char* name,
                                 aura::Window* parent);
 
-  // Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|.
-  // The initial color is determined by the |root_window_type| and whether or
-  // not this is the first boot.
-  void CreateSystemWallpaper(RootWindowType root_window_type);
-
   // Callback for MenuRunner.
   void OnMenuClosed();
 
@@ -344,8 +338,6 @@
   // to it during construction of the shelf widget and status tray.
   std::unique_ptr<Shelf> shelf_;
 
-  std::unique_ptr<SystemWallpaperController> system_wallpaper_;
-
   // Responsible for initializing TouchExplorationController when spoken
   // feedback is on.
   std::unique_ptr<TouchExplorationManager> touch_exploration_manager_;
diff --git a/ash/wm/system_wallpaper_controller.cc b/ash/wm/system_wallpaper_controller.cc
deleted file mode 100644
index 5acd82b..0000000
--- a/ash/wm/system_wallpaper_controller.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2012 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/wm/system_wallpaper_controller.h"
-
-#include "ui/aura/window.h"
-#include "ui/compositor/layer.h"
-#include "ui/compositor/layer_type.h"
-
-namespace ash {
-
-SystemWallpaperController::SystemWallpaperController(aura::Window* root_window,
-                                                     SkColor color)
-    : root_window_(root_window),
-      layer_(std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR)) {
-  root_window_->AddObserver(this);
-  layer_->SetColor(color);
-
-  ui::Layer* root_layer = root_window_->layer();
-  layer_->SetBounds(gfx::Rect(root_layer->bounds().size()));
-  root_layer->Add(layer_.get());
-  root_layer->StackAtBottom(layer_.get());
-}
-
-SystemWallpaperController::~SystemWallpaperController() {
-  root_window_->RemoveObserver(this);
-}
-
-void SystemWallpaperController::OnWindowBoundsChanged(
-    aura::Window* root,
-    const gfx::Rect& old_bounds,
-    const gfx::Rect& new_bounds,
-    ui::PropertyChangeReason reason) {
-  DCHECK_EQ(root_window_, root);
-  layer_->SetBounds(gfx::Rect(root_window_->layer()->bounds().size()));
-}
-
-}  // namespace ash
diff --git a/ash/wm/system_wallpaper_controller.h b/ash/wm/system_wallpaper_controller.h
deleted file mode 100644
index b805365..0000000
--- a/ash/wm/system_wallpaper_controller.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2012 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_WM_SYSTEM_WALLPAPER_CONTROLLER_H_
-#define ASH_WM_SYSTEM_WALLPAPER_CONTROLLER_H_
-
-#include <memory>
-
-#include "base/memory/raw_ptr.h"
-#include "third_party/skia/include/core/SkColor.h"
-#include "ui/aura/window_observer.h"
-
-namespace ui {
-class Layer;
-}
-
-namespace ash {
-
-// SystemWallpaperController manages a ui::Layer that's stacked at the bottom
-// of an aura::RootWindow's children.  It exists solely to obscure portions of
-// the root layer that aren't covered by any other layers (e.g. before the
-// wallpaper image is loaded at startup, or when we scale down all of the other
-// layers as part of a power-button or window-management animation).
-// It should never be transformed or restacked.
-class SystemWallpaperController : public aura::WindowObserver {
- public:
-  SystemWallpaperController(aura::Window* root_window, SkColor color);
-
-  SystemWallpaperController(const SystemWallpaperController&) = delete;
-  SystemWallpaperController& operator=(const SystemWallpaperController&) =
-      delete;
-
-  ~SystemWallpaperController() override;
-
-  // aura::WindowObserver:
-  void OnWindowBoundsChanged(aura::Window* root,
-                             const gfx::Rect& old_bounds,
-                             const gfx::Rect& new_bounds,
-                             ui::PropertyChangeReason reason) override;
-
- private:
-  raw_ptr<aura::Window> root_window_;  // not owned
-
-  std::unique_ptr<ui::Layer> layer_;
-};
-
-}  // namespace ash
-
-#endif  // ASH_WM_SYSTEM_WALLPAPER_CONTROLLER_H_