| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
| 9 #include "ash/wm/frame_painter.h" | 9 #include "ash/wm/frame_painter.h" |
| 10 #include "chrome/browser/themes/theme_properties.h" | 10 #include "chrome/browser/themes/theme_properties.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 return delegate->GetWindowIcon(); | 365 return delegate->GetWindowIcon(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 /////////////////////////////////////////////////////////////////////////////// | 368 /////////////////////////////////////////////////////////////////////////////// |
| 369 // BrowserNonClientFrameViewAsh, private: | 369 // BrowserNonClientFrameViewAsh, private: |
| 370 | 370 |
| 371 int BrowserNonClientFrameViewAsh::NonClientTopBorderHeight() const { | 371 int BrowserNonClientFrameViewAsh::NonClientTopBorderHeight() const { |
| 372 if (!ShouldPaint() || browser_view()->IsTabStripVisible()) | 372 if (!ShouldPaint() || browser_view()->IsTabStripVisible()) |
| 373 return 0; | 373 return 0; |
| 374 | 374 |
| 375 // For windows without a tab strip (popups, etc.) ensure we have enough space | 375 int caption_buttons_bottom = caption_button_container_->bounds().bottom(); |
| 376 // to see the window caption buttons. | 376 if (browser_view()->IsToolbarVisible()) |
| 377 return caption_button_container_->bounds().bottom() - kContentShadowHeight; | 377 return caption_buttons_bottom - kContentShadowHeight; |
| 378 return caption_buttons_bottom + kClientEdgeThickness; |
| 378 } | 379 } |
| 379 | 380 |
| 380 bool BrowserNonClientFrameViewAsh::UseShortHeader() const { | 381 bool BrowserNonClientFrameViewAsh::UseShortHeader() const { |
| 381 // Restored browser -> tall header | 382 // Restored browser -> tall header |
| 382 // Maximized browser -> short header | 383 // Maximized browser -> short header |
| 383 // Fullscreen browser, no immersive reveal -> hidden or super short light bar | 384 // Fullscreen browser, no immersive reveal -> hidden or super short light bar |
| 384 // Fullscreen browser, immersive reveal -> short header | 385 // Fullscreen browser, immersive reveal -> short header |
| 385 // Popup&App window -> tall header | 386 // Popup&App window -> tall header |
| 386 // Panels use short header and are handled via ash::PanelFrameView. | 387 // Panels use short header and are handled via ash::PanelFrameView. |
| 387 // Dialogs use short header and are handled via ash::CustomFrameViewAsh. | 388 // Dialogs use short header and are handled via ash::CustomFrameViewAsh. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 int BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImageId() const { | 556 int BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImageId() const { |
| 556 ui::ThemeProvider* tp = GetThemeProvider(); | 557 ui::ThemeProvider* tp = GetThemeProvider(); |
| 557 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && | 558 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && |
| 558 browser_view()->IsBrowserTypeNormal() && | 559 browser_view()->IsBrowserTypeNormal() && |
| 559 !browser_view()->IsOffTheRecord()) { | 560 !browser_view()->IsOffTheRecord()) { |
| 560 return ShouldPaintAsActive() ? | 561 return ShouldPaintAsActive() ? |
| 561 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE; | 562 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE; |
| 562 } | 563 } |
| 563 return 0; | 564 return 0; |
| 564 } | 565 } |
| OLD | NEW |