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

Unified Diff: ash/frame/default_header_painter.cc

Issue 916293002: Remove ash default frame highlighting for custom colored frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« ash/frame/default_header_painter.h ('K') | « ash/frame/default_header_painter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/frame/default_header_painter.cc
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index 125cb510e2c161da0730ab929f8529cdaea95fad..26107aeb87bcbd709d030a950f60927c316dcbd5 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -242,6 +242,9 @@ void DefaultHeaderPainter::AnimationProgressed(
void DefaultHeaderPainter::PaintHighlightForInactiveRestoredWindow(
gfx::Canvas* canvas) {
+ if (HasCustomFrameColors())
pkotwicz 2015/02/12 02:04:52 I think it would make more sense to add this logic
benwells 2015/02/12 02:36:10 Done.
+ return;
+
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
gfx::ImageSkia top_edge = *rb.GetImageSkiaNamed(
IDR_AURA_WINDOW_HEADER_SHADE_INACTIVE_TOP);
@@ -286,6 +289,9 @@ void DefaultHeaderPainter::PaintTitleBar(gfx::Canvas* canvas) {
}
void DefaultHeaderPainter::PaintHeaderContentSeparator(gfx::Canvas* canvas) {
+ if (HasCustomFrameColors())
+ return;
+
SkColor color = (mode_ == MODE_ACTIVE) ?
kHeaderContentSeparatorColor :
kHeaderContentSeparatorInactiveColor;
@@ -340,6 +346,11 @@ gfx::Rect DefaultHeaderPainter::GetTitleBounds() const {
left_header_view_, caption_button_container_, GetTitleFontList());
}
+bool DefaultHeaderPainter::HasCustomFrameColors() const {
+ return active_frame_color_ != kDefaultFrameColor ||
+ inactive_frame_color_ != kDefaultFrameColor;
+}
+
SkColor DefaultHeaderPainter::GetInactiveFrameColor() const {
SkColor color = inactive_frame_color_;
if (!frame_->IsMaximized() && !frame_->IsFullscreen()) {
« ash/frame/default_header_painter.h ('K') | « ash/frame/default_header_painter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698