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

Unified Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 146343002: Refactor OpaqueBrowserFrameView; reduce uses of kUseSystemTitleBar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index 4959ec363e5cb8783992d53023378c2d99fabb83..ba8bfda18ce51ff1e965cc13fc3a465e8515531f 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -431,26 +431,12 @@ void OpaqueBrowserFrameView::Observe(
// OpaqueBrowserFrameView, OpaqueBrowserFrameViewLayoutDelegate implementation:
bool OpaqueBrowserFrameView::ShouldShowWindowIcon() const {
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
- // If using the system title bar, we do not want to show a second title bar
- // inside the client area.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseSystemTitleBar))
- return false;
-#endif
-
views::WidgetDelegate* delegate = frame()->widget_delegate();
return ShouldShowWindowTitleBar() && delegate &&
delegate->ShouldShowWindowIcon();
}
bool OpaqueBrowserFrameView::ShouldShowWindowTitle() const {
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
- // If using the system title bar, we do not want to show a second title bar
- // inside the client area.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseSystemTitleBar))
- return false;
-#endif
-
// |delegate| may be NULL if called from callback of InputMethodChanged while
// a window is being destroyed.
// See more discussion at http://crosbug.com/8958
@@ -483,12 +469,6 @@ gfx::Size OpaqueBrowserFrameView::GetBrowserViewMinimumSize() const {
}
bool OpaqueBrowserFrameView::ShouldShowCaptionButtons() const {
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
- // Do not show caption buttons if the system title bar is being used.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseSystemTitleBar))
- return false;
-#endif
-
if (!OpaqueBrowserFrameViewLayout::ShouldAddDefaultCaptionButtons())
return false;
return ShouldShowWindowTitleBar();
@@ -614,6 +594,14 @@ gfx::Rect OpaqueBrowserFrameView::IconBounds() const {
}
bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const {
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ // Do not show the custom title bar if the system title bar option is enabled.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseSystemTitleBar))
+ return false;
+#endif
+
+ // Do not show caption buttons if the window manager is forcefully providing a
+ // title bar (e.g., in Ubuntu Unity, if the window is maximized).
if (!views::ViewsDelegate::views_delegate)
return true;
return !views::ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar(
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698