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/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 return layout_->NonClientBorderThickness(); | 589 return layout_->NonClientBorderThickness(); |
590 } | 590 } |
591 | 591 |
592 gfx::Rect OpaqueBrowserFrameView::IconBounds() const { | 592 gfx::Rect OpaqueBrowserFrameView::IconBounds() const { |
593 return layout_->IconBounds(); | 593 return layout_->IconBounds(); |
594 } | 594 } |
595 | 595 |
596 bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const { | 596 bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const { |
597 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 597 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
598 // Do not show the custom title bar if the system title bar option is enabled. | 598 // Do not show the custom title bar if the system title bar option is enabled. |
599 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseSystemTitleBar)) | 599 if (!frame()->UseCustomFrame()) |
600 return false; | 600 return false; |
601 #endif | 601 #endif |
602 | 602 |
603 // Do not show caption buttons if the window manager is forcefully providing a | 603 // Do not show caption buttons if the window manager is forcefully providing a |
604 // title bar (e.g., in Ubuntu Unity, if the window is maximized). | 604 // title bar (e.g., in Ubuntu Unity, if the window is maximized). |
605 if (!views::ViewsDelegate::views_delegate) | 605 if (!views::ViewsDelegate::views_delegate) |
606 return true; | 606 return true; |
607 return !views::ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar( | 607 return !views::ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar( |
608 IsMaximized()); | 608 IsMaximized()); |
609 } | 609 } |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 914 |
915 int OpaqueBrowserFrameView::GetTopAreaHeight() const { | 915 int OpaqueBrowserFrameView::GetTopAreaHeight() const { |
916 gfx::ImageSkia* frame_image = GetFrameImage(); | 916 gfx::ImageSkia* frame_image = GetFrameImage(); |
917 int top_area_height = frame_image->height(); | 917 int top_area_height = frame_image->height(); |
918 if (browser_view()->IsTabStripVisible()) { | 918 if (browser_view()->IsTabStripVisible()) { |
919 top_area_height = std::max(top_area_height, | 919 top_area_height = std::max(top_area_height, |
920 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); | 920 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); |
921 } | 921 } |
922 return top_area_height; | 922 return top_area_height; |
923 } | 923 } |
OLD | NEW |