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/common/ash_layout_constants.h" | 7 #include "ash/common/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 "base/logging.h" // DCHECK | 10 #include "base/logging.h" // DCHECK |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // window_icon may be null. | 145 // window_icon may be null. |
146 DCHECK(caption_button_container); | 146 DCHECK(caption_button_container); |
147 frame_ = frame; | 147 frame_ = frame; |
148 | 148 |
149 is_tabbed_ = browser_view->browser()->is_type_tabbed(); | 149 is_tabbed_ = browser_view->browser()->is_type_tabbed(); |
150 is_incognito_ = !browser_view->IsRegularOrGuestSession(); | 150 is_incognito_ = !browser_view->IsRegularOrGuestSession(); |
151 | 151 |
152 view_ = header_view; | 152 view_ = header_view; |
153 window_icon_ = window_icon; | 153 window_icon_ = window_icon; |
154 caption_button_container_ = caption_button_container; | 154 caption_button_container_ = caption_button_container; |
155 // Use light images in otr, even when a custom theme is installed. The | 155 // Use light images in incognito, even when a custom theme is installed. The |
156 // otr window with a custom theme is still darker than a normal window. | 156 // incognito window with a custom theme is still darker than a normal window. |
157 caption_button_container_->SetUseLightImages(is_incognito_); | 157 caption_button_container_->SetUseLightImages(is_incognito_); |
158 } | 158 } |
159 | 159 |
160 int BrowserHeaderPainterAsh::GetMinimumHeaderWidth() const { | 160 int BrowserHeaderPainterAsh::GetMinimumHeaderWidth() const { |
161 // Ensure we have enough space for the window icon and buttons. We allow | 161 // Ensure we have enough space for the window icon and buttons. We allow |
162 // the title string to collapse to zero width. | 162 // the title string to collapse to zero width. |
163 return GetTitleBounds().x() + | 163 return GetTitleBounds().x() + |
164 caption_button_container_->GetMinimumSize().width(); | 164 caption_button_container_->GetMinimumSize().width(); |
165 } | 165 } |
166 | 166 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 366 } |
367 | 367 |
368 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const { | 368 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const { |
369 return gfx::Rect(view_->width(), painted_height_); | 369 return gfx::Rect(view_->width(), painted_height_); |
370 } | 370 } |
371 | 371 |
372 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const { | 372 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const { |
373 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_, | 373 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_, |
374 caption_button_container_, BrowserFrame::GetTitleFontList()); | 374 caption_button_container_, BrowserFrame::GetTitleFontList()); |
375 } | 375 } |
OLD | NEW |