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

Unified Diff: ash/frame/default_header_painter.cc

Issue 664443002: Support chrome app frame colors on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 6 years, 2 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
« no previous file with comments | « ash/frame/default_header_painter.h ('k') | chrome/browser/ui/views/apps/chrome_native_app_window_views.cc » ('j') | 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 0819d4dffd25f082a06c1712312d55e2005f9075..f981c1284ab64367af44c5282e687ccb78a39d55 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -35,8 +35,8 @@ const SkColor kHeaderContentSeparatorColor = SkColorSetRGB(150, 150, 152);
// Color of the inactive window header/content separator line.
const SkColor kHeaderContentSeparatorInactiveColor =
SkColorSetRGB(180, 180, 182);
-// The color of the frame.
-const SkColor kFrameColor = SkColorSetRGB(242, 242, 242);
+// The default color of the frame.
+const SkColor kDefaultFrameColor = SkColorSetRGB(242, 242, 242);
// The alpha of the inactive frame.
const SkAlpha kInactiveFrameAlpha = 204;
// Duration of crossfade animation for activating and deactivating frame.
@@ -79,6 +79,8 @@ DefaultHeaderPainter::DefaultHeaderPainter()
view_(NULL),
left_header_view_(NULL),
left_view_x_inset_(HeaderPainterUtil::GetDefaultLeftViewXInset()),
+ active_frame_color_(kDefaultFrameColor),
+ inactive_frame_color_(kDefaultFrameColor),
caption_button_container_(NULL),
height_(0),
mode_(MODE_INACTIVE),
@@ -164,7 +166,7 @@ void DefaultHeaderPainter::PaintHeader(gfx::Canvas* canvas, Mode mode) {
SkPaint paint;
int active_alpha = activation_animation_->CurrentValueBetween(0, 255);
paint.setColor(color_utils::AlphaBlend(
- kFrameColor, GetInactiveFrameColor(), active_alpha));
+ active_frame_color_, GetInactiveFrameColor(), active_alpha));
TileRoundRect(canvas, paint, GetLocalBounds(), corner_radius);
@@ -217,6 +219,12 @@ void DefaultHeaderPainter::UpdateLeftViewXInset(int left_view_x_inset) {
}
}
+void DefaultHeaderPainter::SetFrameColors(SkColor active_frame_color,
+ SkColor inactive_frame_color) {
+ active_frame_color_ = active_frame_color;
+ inactive_frame_color_ = inactive_frame_color;
+}
+
void DefaultHeaderPainter::UpdateLeftHeaderView(views::View* left_header_view) {
left_header_view_ = left_header_view;
}
@@ -333,7 +341,7 @@ gfx::Rect DefaultHeaderPainter::GetTitleBounds() const {
}
SkColor DefaultHeaderPainter::GetInactiveFrameColor() const {
- SkColor color = kFrameColor;
+ SkColor color = inactive_frame_color_;
if (!frame_->IsMaximized() && !frame_->IsFullscreen()) {
color = SkColorSetARGB(kInactiveFrameAlpha,
SkColorGetR(color),
« no previous file with comments | « ash/frame/default_header_painter.h ('k') | chrome/browser/ui/views/apps/chrome_native_app_window_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698