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

Side by Side Diff: chrome/browser/ui/views/frame/browser_header_painter_ash.cc

Issue 2897533003: Change default ink drop center points to center of contents bounds (Closed)
Patch Set: fix compile Created 3 years, 7 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 "chrome/browser/ui/views/frame/browser_header_painter_ash.h" 5 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h"
6 6
7 #include "ash/ash_layout_constants.h" 7 #include "ash/ash_layout_constants.h"
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
9 #include "ash/frame/header_painter_util.h" 9 #include "ash/frame/header_painter_util.h"
10 #include "ash/resources/vector_icons/vector_icons.h" 10 #include "ash/resources/vector_icons/vector_icons.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 corner_radius = ash::HeaderPainterUtil::GetTopCornerRadiusWhenRestored(); 256 corner_radius = ash::HeaderPainterUtil::GetTopCornerRadiusWhenRestored();
257 257
258 PaintFrameImagesInRoundRect( 258 PaintFrameImagesInRoundRect(
259 canvas, frame_image, frame_overlay_image, alpha, background_color, 259 canvas, frame_image, frame_overlay_image, alpha, background_color,
260 GetPaintedBounds(), corner_radius, 260 GetPaintedBounds(), corner_radius,
261 ash::HeaderPainterUtil::GetThemeBackgroundXInset()); 261 ash::HeaderPainterUtil::GetThemeBackgroundXInset());
262 } 262 }
263 263
264 void BrowserHeaderPainterAsh::PaintTitleBar(gfx::Canvas* canvas) { 264 void BrowserHeaderPainterAsh::PaintTitleBar(gfx::Canvas* canvas) {
265 // The window icon is painted by its own views::View. 265 // The window icon is painted by its own views::View.
266 gfx::Rect title_bounds = GetTitleBounds();
267 title_bounds.set_x(view_->GetMirroredXForRect(title_bounds));
268 canvas->DrawStringRectWithFlags(frame_->widget_delegate()->GetWindowTitle(), 266 canvas->DrawStringRectWithFlags(frame_->widget_delegate()->GetWindowTitle(),
269 BrowserFrame::GetTitleFontList(), 267 BrowserFrame::GetTitleFontList(),
270 is_incognito_ ? kIncognitoWindowTitleTextColor 268 is_incognito_ ? kIncognitoWindowTitleTextColor
271 : kNormalWindowTitleTextColor, 269 : kNormalWindowTitleTextColor,
272 title_bounds, 270 view_->GetMirroredRect(GetTitleBounds()),
273 gfx::Canvas::NO_SUBPIXEL_RENDERING); 271 gfx::Canvas::NO_SUBPIXEL_RENDERING);
274 } 272 }
275 273
276 void BrowserHeaderPainterAsh::UpdateCaptionButtons() { 274 void BrowserHeaderPainterAsh::UpdateCaptionButtons() {
277 caption_button_container_->SetButtonImage(ash::CAPTION_BUTTON_ICON_MINIMIZE, 275 caption_button_container_->SetButtonImage(ash::CAPTION_BUTTON_ICON_MINIMIZE,
278 ash::kWindowControlMinimizeIcon); 276 ash::kWindowControlMinimizeIcon);
279 caption_button_container_->SetButtonImage(ash::CAPTION_BUTTON_ICON_CLOSE, 277 caption_button_container_->SetButtonImage(ash::CAPTION_BUTTON_ICON_CLOSE,
280 ash::kWindowControlCloseIcon); 278 ash::kWindowControlCloseIcon);
281 caption_button_container_->SetButtonImage( 279 caption_button_container_->SetButtonImage(
282 ash::CAPTION_BUTTON_ICON_LEFT_SNAPPED, 280 ash::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
(...skipping 16 matching lines...) Expand all
299 } 297 }
300 298
301 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const { 299 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const {
302 return gfx::Rect(view_->width(), painted_height_); 300 return gfx::Rect(view_->width(), painted_height_);
303 } 301 }
304 302
305 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const { 303 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const {
306 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_, 304 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_,
307 caption_button_container_, BrowserFrame::GetTitleFontList()); 305 caption_button_container_, BrowserFrame::GetTitleFontList());
308 } 306 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698