Commit eb86464a authored by Wenzhao Zang's avatar Wenzhao Zang Committed by Commit Bot

Move all login screen related constants to a separate file

Login/lock screen related constants may be used from at least three
places: views-based lock, WebUi based login/lock and wallpaper. So
we want to move them together just as shelf_constants.h

Bug: 732566, 733409
Change-Id: I791d5dfbd02f35cdcc6064b964b97b6978a376d2
Reviewed-on: https://chromium-review.googlesource.com/590483Reviewed-by: default avatarDan Erat <derat@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491196}
parent 548607f5
......@@ -217,6 +217,7 @@ component("ash") {
"login/ui/lock_window.h",
"login/ui/login_auth_user_view.cc",
"login/ui/login_auth_user_view.h",
"login/ui/login_constants.h",
"login/ui/login_data_dispatcher.cc",
"login/ui/login_data_dispatcher.h",
"login/ui/login_password_view.cc",
......
......@@ -7,6 +7,7 @@
#include "ash/login/ui/lock_contents_view.h"
#include "ash/login/ui/lock_debug_view.h"
#include "ash/login/ui/lock_window.h"
#include "ash/login/ui/login_constants.h"
#include "ash/login/ui/login_data_dispatcher.h"
#include "ash/public/interfaces/session_controller.mojom.h"
#include "ash/root_window_controller.h"
......@@ -99,15 +100,12 @@ void LockScreen::Destroy() {
}
void LockScreen::ToggleBlur() {
// TODO(jdufault): Use correct blur amount.
float target_blur = 20.0f;
for (aura::Window* window : Shell::GetAllRootWindows()) {
ui::Layer* layer = GetWallpaperLayerForWindow(window);
if (layer->layer_blur() == target_blur) {
if (layer->layer_blur() > 0.0f) {
layer->SetLayerBlur(0.0f);
} else {
layer->SetLayerBlur(target_blur);
layer->SetLayerBlur(login_constants::kBlurSigma);
}
}
}
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_LOGIN_UI_LOGIN_CONSTANTS_H
#define ASH_LOGIN_UI_LOGIN_CONSTANTS_H
#include "third_party/skia/include/core/SkColor.h"
namespace ash {
namespace login_constants {
// The default base color of the login/lock screen when the dark muted color
// extracted from wallpaper is invalid.
constexpr SkColor kDefaultBaseColor = SK_ColorBLACK;
// The alpha value for the login/lock screen background.
constexpr int kTranslucentAlpha = 153;
// The alpha value for the scrollable container on the account picker.
constexpr int kScrollTranslucentAlpha = 76;
// The alpha value used to darken the login/lock screen.
constexpr int kTranslucentColorDarkenAlpha = 128;
// The blur sigma for login/lock screen.
constexpr float kBlurSigma = 30.0f;
} // namespace login_constants
} // namespace ash
#endif // ASH_LOGIN_UI_LOGIN_CONSTANTS_H
\ No newline at end of file
......@@ -9,9 +9,9 @@
#include <algorithm>
#include <vector>
#include "ash/login/ui/login_constants.h"
#include "ash/public/interfaces/constants.mojom.h"
#include "ash/public/interfaces/tray_action.mojom.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shell.h"
#include "ash/shutdown_reason.h"
#include "ash/system/devicetype_utils.h"
......@@ -132,11 +132,6 @@ const char kAvailableLockScreenApps[] = "LOCK_SCREEN_APPS_STATE.AVAILABLE";
const char kLaunchRequestedLockScreenApps[] =
"LOCK_SCREEN_APPS_STATE.LAUNCH_REQUESTED";
// The alpha value for the signin screen background.
// TODO(crbug.com/732566): Move all constants related to views-based signin
// screen to a separate file.
constexpr int kLoginTranslucentAlpha = 76;
class CallOnReturn {
public:
explicit CallOnReturn(const base::Closure& callback)
......@@ -874,12 +869,13 @@ void SigninScreenHandler::SetSigninScreenColors(SkColor dark_muted_color) {
// The dark muted color should have 100% opacity.
dark_muted_color = SkColorSetA(dark_muted_color, 0xFF);
SkColor base_color = color_utils::GetResultingPaintColor(
SkColorSetA(ash::kShelfDefaultBaseColor,
ash::kShelfTranslucentColorDarkenAlpha),
SkColorSetA(ash::login_constants::kDefaultBaseColor,
ash::login_constants::kTranslucentColorDarkenAlpha),
dark_muted_color);
SkColor background_color =
SkColorSetA(base_color, ash::kShelfTranslucentAlpha);
SkColor scroll_color = SkColorSetA(base_color, kLoginTranslucentAlpha);
SkColorSetA(base_color, ash::login_constants::kTranslucentAlpha);
SkColor scroll_color =
SkColorSetA(base_color, ash::login_constants::kScrollTranslucentAlpha);
CallJS("login.AccountPickerScreen.setOverlayColors",
color_utils::SkColorToRgbaString(dark_muted_color),
color_utils::SkColorToRgbaString(scroll_color),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment