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

Side by Side Diff: ash/common/frame/default_header_painter.cc

Issue 2277563002: Wires up immersive mode for chrome and mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/frame/default_header_painter.h" 5 #include "ash/common/frame/default_header_painter.h"
6 6
7 #include "ash/common/ash_layout_constants.h" 7 #include "ash/common/ash_layout_constants.h"
8 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h " 8 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h "
9 #include "ash/common/frame/header_painter_util.h" 9 #include "ash/common/frame/header_painter_util.h"
10 #include "base/debug/leak_annotations.h" 10 #include "base/debug/leak_annotations.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 int active_alpha = activation_animation_->CurrentValueBetween(0, 255); 143 int active_alpha = activation_animation_->CurrentValueBetween(0, 255);
144 paint.setColor(color_utils::AlphaBlend(active_frame_color_, 144 paint.setColor(color_utils::AlphaBlend(active_frame_color_,
145 inactive_frame_color_, active_alpha)); 145 inactive_frame_color_, active_alpha));
146 146
147 TileRoundRect(canvas, paint, GetLocalBounds(), corner_radius); 147 TileRoundRect(canvas, paint, GetLocalBounds(), corner_radius);
148 148
149 if (!frame_->IsMaximized() && !frame_->IsFullscreen() && 149 if (!frame_->IsMaximized() && !frame_->IsFullscreen() &&
150 mode_ == MODE_INACTIVE && !UsesCustomFrameColors()) { 150 mode_ == MODE_INACTIVE && !UsesCustomFrameColors()) {
151 PaintHighlightForInactiveRestoredWindow(canvas); 151 PaintHighlightForInactiveRestoredWindow(canvas);
152 } 152 }
153 if (frame_->widget_delegate() && 153 if (frame_->widget_delegate()->ShouldShowWindowTitle())
154 frame_->widget_delegate()->ShouldShowWindowTitle()) {
155 PaintTitleBar(canvas); 154 PaintTitleBar(canvas);
156 }
157 if (!UsesCustomFrameColors()) 155 if (!UsesCustomFrameColors())
158 PaintHeaderContentSeparator(canvas); 156 PaintHeaderContentSeparator(canvas);
159 } 157 }
160 158
161 void DefaultHeaderPainter::LayoutHeader() { 159 void DefaultHeaderPainter::LayoutHeader() {
162 caption_button_container_->SetUseLightImages(ShouldUseLightImages()); 160 caption_button_container_->SetUseLightImages(ShouldUseLightImages());
163 UpdateSizeButtonImages(); 161 UpdateSizeButtonImages();
164 caption_button_container_->Layout(); 162 caption_button_container_->Layout();
165 163
166 gfx::Size caption_button_container_size = 164 gfx::Size caption_button_container_size =
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 return HeaderPainterUtil::GetTitleBounds( 308 return HeaderPainterUtil::GetTitleBounds(
311 left_header_view_, caption_button_container_, GetTitleFontList()); 309 left_header_view_, caption_button_container_, GetTitleFontList());
312 } 310 }
313 311
314 bool DefaultHeaderPainter::UsesCustomFrameColors() const { 312 bool DefaultHeaderPainter::UsesCustomFrameColors() const {
315 return active_frame_color_ != kDefaultFrameColor || 313 return active_frame_color_ != kDefaultFrameColor ||
316 inactive_frame_color_ != kDefaultFrameColor; 314 inactive_frame_color_ != kDefaultFrameColor;
317 } 315 }
318 316
319 } // namespace ash 317 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698