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

Unified Diff: ui/views/window/custom_frame_view.cc

Issue 98793009: Linux Aura: Hide title bar when CustomFrameView maximized on Unity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Note: kUseSystemTitleBar check moved to OpaqueBrowserFrameView. 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 | « ui/views/window/custom_frame_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/custom_frame_view.cc
diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc
index bb27dc60ca5b57ced6b20b372c4ae82b7c0be6c6..5ef022bd793a4c8987c3c448af3324520d5c083d 100644
--- a/ui/views/window/custom_frame_view.cc
+++ b/ui/views/window/custom_frame_view.cc
@@ -18,6 +18,7 @@
#include "ui/gfx/path.h"
#include "ui/views/color_constants.h"
#include "ui/views/controls/button/image_button.h"
+#include "ui/views/views_delegate.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/client_view.h"
@@ -186,7 +187,7 @@ int CustomFrameView::NonClientHitTest(const gfx::Point& point) {
void CustomFrameView::GetWindowMask(const gfx::Size& size,
gfx::Path* window_mask) {
DCHECK(window_mask);
- if (frame_->IsMaximized())
+ if (frame_->IsMaximized() || !ShouldShowTitleBarAndBorder())
return;
GetDefaultWindowMask(size, window_mask);
@@ -212,6 +213,9 @@ void CustomFrameView::UpdateWindowTitle() {
// CustomFrameView, View overrides:
void CustomFrameView::OnPaint(gfx::Canvas* canvas) {
+ if (!ShouldShowTitleBarAndBorder())
+ return;
+
if (frame_->IsMaximized())
PaintMaximizedFrameBorder(canvas);
else
@@ -222,8 +226,11 @@ void CustomFrameView::OnPaint(gfx::Canvas* canvas) {
}
void CustomFrameView::Layout() {
- LayoutWindowControls();
- LayoutTitleBar();
+ if (ShouldShowTitleBarAndBorder()) {
+ LayoutWindowControls();
+ LayoutTitleBar();
+ }
+
LayoutClientView();
}
@@ -323,8 +330,17 @@ gfx::Rect CustomFrameView::IconBounds() const {
return gfx::Rect(frame_thickness + kIconLeftSpacing, y, size, size);
}
+bool CustomFrameView::ShouldShowTitleBarAndBorder() const {
+ if (ViewsDelegate::views_delegate) {
+ return !ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar(
+ frame_->IsMaximized());
+ }
+
+ return true;
+}
+
bool CustomFrameView::ShouldShowClientEdge() const {
- return !frame_->IsMaximized();
+ return !frame_->IsMaximized() && ShouldShowTitleBarAndBorder();
}
void CustomFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) {
@@ -549,6 +565,11 @@ void CustomFrameView::LayoutTitleBar() {
}
void CustomFrameView::LayoutClientView() {
+ if (!ShouldShowTitleBarAndBorder()) {
+ client_view_bounds_ = bounds();
+ return;
+ }
+
int top_height = NonClientTopBorderHeight();
int border_thickness = NonClientBorderThickness();
client_view_bounds_.SetRect(border_thickness, top_height,
« no previous file with comments | « ui/views/window/custom_frame_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698