| OLD | NEW |
| 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/frame/caption_buttons/frame_caption_button_container_view.h" | 7 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 8 #include "ash/frame/header_painter_util.h" | 8 #include "ash/frame/header_painter_util.h" |
| 9 #include "base/logging.h" // DCHECK | 9 #include "base/logging.h" // DCHECK |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 caption_button_container_->GetPreferredSize(); | 241 caption_button_container_->GetPreferredSize(); |
| 242 caption_button_container_->SetBounds( | 242 caption_button_container_->SetBounds( |
| 243 view_->width() - caption_button_container_size.width(), | 243 view_->width() - caption_button_container_size.width(), |
| 244 0, | 244 0, |
| 245 caption_button_container_size.width(), | 245 caption_button_container_size.width(), |
| 246 caption_button_container_size.height()); | 246 caption_button_container_size.height()); |
| 247 | 247 |
| 248 if (window_icon_) { | 248 if (window_icon_) { |
| 249 // Vertically center the window icon with respect to the caption button | 249 // Vertically center the window icon with respect to the caption button |
| 250 // container. | 250 // container. |
| 251 int icon_size = ash::HeaderPainterUtil::GetIconSize(); | 251 int icon_size = ash::HeaderPainterUtil::GetDefaultIconSize(); |
| 252 int icon_offset_y = (caption_button_container_->height() - icon_size) / 2; | 252 int icon_offset_y = (caption_button_container_->height() - icon_size) / 2; |
| 253 window_icon_->SetBounds(ash::HeaderPainterUtil::GetIconXOffset(), | 253 window_icon_->SetBounds(ash::HeaderPainterUtil::GetIconXOffset(), |
| 254 icon_offset_y, icon_size, icon_size); | 254 icon_offset_y, icon_size, icon_size); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 int BrowserHeaderPainterAsh::GetHeaderHeightForPainting() const { | 258 int BrowserHeaderPainterAsh::GetHeaderHeightForPainting() const { |
| 259 return painted_height_; | 259 return painted_height_; |
| 260 } | 260 } |
| 261 | 261 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 465 } |
| 466 | 466 |
| 467 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const { | 467 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const { |
| 468 return gfx::Rect(view_->width(), painted_height_); | 468 return gfx::Rect(view_->width(), painted_height_); |
| 469 } | 469 } |
| 470 | 470 |
| 471 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const { | 471 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const { |
| 472 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_, | 472 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_, |
| 473 caption_button_container_, BrowserFrame::GetTitleFontList()); | 473 caption_button_container_, BrowserFrame::GetTitleFontList()); |
| 474 } | 474 } |
| OLD | NEW |