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

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

Issue 567463002: Color picker window should not have a minimize button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and Added unit test for minimize button visibility. Created 6 years, 3 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/widget/widget_delegate.cc ('k') | ui/views/window/custom_frame_view_unittest.cc » ('j') | 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 83188abdc4b58ea4e81b06ad79b3e404c9204587..dcc3e69be88185e8794ddd78ff074998e424fec9 100644
--- a/ui/views/window/custom_frame_view.cc
+++ b/ui/views/window/custom_frame_view.cc
@@ -599,6 +599,13 @@ ImageButton* CustomFrameView::GetImageButton(views::FrameButton frame_button) {
switch (frame_button) {
case views::FRAME_BUTTON_MINIMIZE: {
button = minimize_button_;
+ // If we should not show the minimize button, then we return NULL as we
+ // don't want this button to become visible and to be laid out.
+ bool should_show = frame_->widget_delegate()->CanMinimize();
+ button->SetVisible(should_show);
+ if (!should_show)
+ return NULL;
+
break;
}
case views::FRAME_BUTTON_MAXIMIZE: {
« no previous file with comments | « ui/views/widget/widget_delegate.cc ('k') | ui/views/window/custom_frame_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698