Commit 01323107 authored by Dominique Fauteux-Chapleau's avatar Dominique Fauteux-Chapleau Committed by Commit Bot

Remove hard-coded colors from DeepScanningDialogDelegate

Replace hard-coded colors with ones taken from the theme and background
instead. Also add back some code that set text properties that were
removed by mistake in a previous CL.

Bug: 999145
Change-Id: I8f43c87b71dc3f4025433058729239e6cdb4ade5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2028300Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Dominique Fauteux-Chapleau <domfc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738924}
parent 2164b55d
......@@ -24,13 +24,14 @@ class ImageSkia;
} // namespace gfx
namespace views {
class ImageView;
class Throbber;
class Widget;
} // namespace views
namespace safe_browsing {
class DeepScanningTopImageView;
class DeepScanningSideIconImageView;
class DeepScanningSideIconSpinnerView;
class DeepScanningMessageView;
// Dialog shown for Deep Scanning to offer the possibility of cancelling the
// upload to the user.
......@@ -69,9 +70,6 @@ class DeepScanningDialogViews : public views::DialogDelegate {
// nothing should be shown.
void ShowResult(bool success);
// Returns the appropriate top image depending on |dialog_status_|.
const gfx::ImageSkia* GetTopImage() const;
// Accessors to simplify |dialog_status_| checking.
inline bool is_success() const {
return dialog_status_ == DeepScanningDialogStatus::SUCCESS;
......@@ -87,6 +85,16 @@ class DeepScanningDialogViews : public views::DialogDelegate {
return dialog_status_ == DeepScanningDialogStatus::PENDING;
}
// Returns the side image's logo color depending on |dialog_status_|.
SkColor GetSideImageLogoColor() const;
// Returns the side image's background circle color depending on
// |dialog_status_|.
SkColor GetSideImageBackgroundColor() const;
// Returns the appropriate top image depending on |dialog_status_|.
const gfx::ImageSkia* GetTopImage() const;
private:
~DeepScanningDialogViews() override;
......@@ -108,9 +116,6 @@ class DeepScanningDialogViews : public views::DialogDelegate {
// Returns the appropriate dialog message depending on |dialog_status_|.
base::string16 GetDialogMessage() const;
// Returns the side image's background circle color.
SkColor GetSideImageBackgroundColor() const;
// Returns the appropriate dialog message depending on |dialog_status_|.
base::string16 GetCancelButtonText() const;
......@@ -138,11 +143,9 @@ class DeepScanningDialogViews : public views::DialogDelegate {
// Views above the buttons. |contents_view_| owns every other view.
std::unique_ptr<views::View> contents_view_;
DeepScanningTopImageView* image_;
views::ImageView* side_icon_image_;
views::Throbber* side_icon_spinner_;
views::Label* message_;
views::Widget* widget_;
DeepScanningSideIconImageView* side_icon_image_;
DeepScanningSideIconSpinnerView* side_icon_spinner_;
DeepScanningMessageView* message_;
bool shown_ = false;
......
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