Commit cecc091b authored by Tom Anderson's avatar Tom Anderson Committed by Chromium LUCI CQ

[GTK] Remove incognito frame tint

R=pkasting

Bug: 1160568
Change-Id: I070f79cbae98df5c958f34f5c930efe817e67962
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622003
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842243}
parent 1a6862eb
......@@ -492,7 +492,6 @@ void OpaqueBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
frame_background_->set_frame_color(frame_color);
frame_background_->set_use_custom_frame(frame()->UseCustomFrame());
frame_background_->set_is_active(active);
frame_background_->set_incognito(browser_view()->IsIncognito());
frame_background_->set_theme_image(GetFrameImage());
const int y_inset =
browser_view()->IsTabStripVisible()
......
......@@ -932,19 +932,14 @@ void GtkUi::UpdateColors() {
const std::string header_selector_inactive = header_selector + ":backdrop";
const SkColor frame_color =
SkColorSetA(GetBgColor(header_selector), SK_AlphaOPAQUE);
const SkColor frame_color_incognito =
color_utils::HSLShift(frame_color, kDefaultTintFrameIncognito);
const SkColor frame_color_inactive =
SkColorSetA(GetBgColor(header_selector_inactive), SK_AlphaOPAQUE);
const SkColor frame_color_incognito_inactive =
color_utils::HSLShift(frame_color_inactive, kDefaultTintFrameIncognito);
color_map[ThemeProperties::COLOR_FRAME_ACTIVE] = frame_color;
color_map[ThemeProperties::COLOR_FRAME_INACTIVE] = frame_color_inactive;
color_map[ThemeProperties::COLOR_FRAME_ACTIVE_INCOGNITO] =
frame_color_incognito;
color_map[ThemeProperties::COLOR_FRAME_ACTIVE_INCOGNITO] = frame_color;
color_map[ThemeProperties::COLOR_FRAME_INACTIVE_INCOGNITO] =
frame_color_incognito_inactive;
frame_color_inactive;
// Compose the window color on the frame color to ensure the resulting tab
// color is opaque.
......@@ -969,20 +964,12 @@ void GtkUi::UpdateColors() {
background_tab_text_color;
color_map[ThemeProperties::
COLOR_TAB_FOREGROUND_INACTIVE_FRAME_ACTIVE_INCOGNITO] =
color_utils::BlendForMinContrast(
color_utils::HSLShift(background_tab_text_color,
kDefaultTintFrameIncognito),
frame_color_incognito)
.color;
background_tab_text_color;
color_map[ThemeProperties::COLOR_TAB_FOREGROUND_INACTIVE_FRAME_INACTIVE] =
background_tab_text_color_inactive;
color_map[ThemeProperties::
COLOR_TAB_FOREGROUND_INACTIVE_FRAME_INACTIVE_INCOGNITO] =
color_utils::BlendForMinContrast(
color_utils::HSLShift(background_tab_text_color_inactive,
kDefaultTintFrameIncognito),
frame_color_incognito_inactive)
.color;
background_tab_text_color_inactive;
color_map[ThemeProperties::COLOR_OMNIBOX_TEXT] =
native_theme_->GetSystemColor(
......
......@@ -116,11 +116,6 @@ int GetKeyEventProperty(const ui::KeyEvent& key_event,
namespace gtk {
// TODO(thomasanderson): ThemeService has a whole interface just for reading
// default constants. Figure out what to do with that more long term; for now,
// just copy the constant itself here.
const color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2f, 0.35f};
void GtkInitFromCommandLine(const base::CommandLine& command_line) {
CommonInitFromCommandLine(command_line);
}
......
......@@ -26,18 +26,12 @@ namespace base {
class CommandLine;
}
namespace color_utils {
struct HSL;
}
namespace ui {
class KeyEvent;
}
namespace gtk {
extern const color_utils::HSL kDefaultTintFrameIncognito;
void GtkInitFromCommandLine(const base::CommandLine& command_line);
// Sets |dialog| as transient for |parent|, which will keep it on top and center
......
......@@ -9,7 +9,6 @@
#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/skbitmap_operations.h"
#include "ui/gfx/skia_util.h"
#include "ui/gtk/gtk_util.h"
......@@ -711,13 +710,7 @@ void NativeThemeGtk::PaintFrameTopArea(
SkBitmap bitmap =
GetWidgetBitmap(rect.size(), context, BG_RENDER_RECURSIVE, false);
if (frame_top_area.incognito) {
bitmap = SkBitmapOperations::CreateHSLShiftedBitmap(
bitmap, kDefaultTintFrameIncognito);
bitmap.setImmutable();
}
canvas->drawImage(cc::PaintImage::CreateFromBitmap(std::move(bitmap)),
rect.x(), rect.y());
}
......
......@@ -172,7 +172,6 @@ class NATIVE_THEME_EXPORT NativeTheme {
// Distinguishes between active (foreground) and inactive
// (background) window frame styles.
bool is_active;
bool incognito;
// True when Chromium renders the titlebar. False when the window
// manager renders the titlebar.
bool use_custom_frame;
......
......@@ -192,7 +192,6 @@ void CustomFrameView::OnPaint(gfx::Canvas* canvas) {
frame_background_->set_frame_color(GetFrameColor());
frame_background_->set_use_custom_frame(true);
frame_background_->set_is_active(ShouldPaintAsActive());
frame_background_->set_incognito(false);
const gfx::ImageSkia frame_image = GetFrameImage();
frame_background_->set_theme_image(frame_image);
frame_background_->set_top_area_height(frame_image.height());
......
......@@ -105,7 +105,6 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas,
ui::NativeTheme::ExtraParams params;
params.frame_top_area.use_custom_frame = use_custom_frame_;
params.frame_top_area.is_active = is_active_;
params.frame_top_area.incognito = incognito_;
params.frame_top_area.default_background_color = frame_color_;
native_theme->Paint(canvas->sk_canvas(), ui::NativeTheme::kFrameTopArea,
ui::NativeTheme::kNormal,
......
......@@ -36,9 +36,6 @@ class VIEWS_EXPORT FrameBackground {
// Sets whether the frame to be drawn should have focus.
void set_is_active(bool is_active) { is_active_ = is_active; }
// Sets whether the frame to be drawn is in incognito mode.
void set_incognito(bool incognito) { incognito_ = incognito; }
// Sets the theme image for the top of the window. May be null (empty).
// Memory is owned by the caller.
void set_theme_image(const gfx::ImageSkia& image) { theme_image_ = image; }
......@@ -90,7 +87,6 @@ class VIEWS_EXPORT FrameBackground {
SkColor frame_color_ = 0;
bool use_custom_frame_ = true;
bool is_active_ = true;
bool incognito_ = false;
gfx::ImageSkia theme_image_;
int theme_image_y_inset_ = 0;
gfx::ImageSkia theme_overlay_image_;
......
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