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

Side by Side Diff: ui/views/bubble/bubble_frame_view.cc

Issue 2253283003: macviews: reinstate close button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/views/bubble/bubble_frame_view.h" 5 #include "ui/views/bubble/bubble_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 static const int kBottomBorderShadowSize = 2; 204 static const int kBottomBorderShadowSize = 2;
205 rect.fBottom += SkIntToScalar(kBottomBorderShadowSize); 205 rect.fBottom += SkIntToScalar(kBottomBorderShadowSize);
206 window_mask->addRect(rect); 206 window_mask->addRect(rect);
207 } 207 }
208 gfx::Path arrow_path; 208 gfx::Path arrow_path;
209 if (bubble_border_->GetArrowPath(gfx::Rect(size), &arrow_path)) 209 if (bubble_border_->GetArrowPath(gfx::Rect(size), &arrow_path))
210 window_mask->addPath(arrow_path, 0, 0); 210 window_mask->addPath(arrow_path, 0, 0);
211 } 211 }
212 212
213 void BubbleFrameView::ResetWindowControls() { 213 void BubbleFrameView::ResetWindowControls() {
214 #if defined(OS_MACOSX)
215 // On Mac, close buttons are never shown.
216 close_->SetVisible(false);
217 #else
218 close_->SetVisible(GetWidget()->widget_delegate()->ShouldShowCloseButton()); 214 close_->SetVisible(GetWidget()->widget_delegate()->ShouldShowCloseButton());
219 #endif
220 } 215 }
221 216
222 void BubbleFrameView::UpdateWindowIcon() { 217 void BubbleFrameView::UpdateWindowIcon() {
223 gfx::ImageSkia image; 218 gfx::ImageSkia image;
224 if (GetWidget()->widget_delegate()->ShouldShowWindowIcon()) 219 if (GetWidget()->widget_delegate()->ShouldShowWindowIcon())
225 image = GetWidget()->widget_delegate()->GetWindowIcon(); 220 image = GetWidget()->widget_delegate()->GetWindowIcon();
226 title_icon_->SetImage(&image); 221 title_icon_->SetImage(&image);
227 } 222 }
228 223
229 void BubbleFrameView::UpdateWindowTitle() { 224 void BubbleFrameView::UpdateWindowTitle() {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 size.Enlarge(client_insets.width(), client_insets.height()); 515 size.Enlarge(client_insets.width(), client_insets.height());
521 size.SetToMax(gfx::Size(title_bar_width, 0)); 516 size.SetToMax(gfx::Size(title_bar_width, 0));
522 517
523 if (footnote_container_) 518 if (footnote_container_)
524 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); 519 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width()));
525 520
526 return size; 521 return size;
527 } 522 }
528 523
529 } // namespace views 524 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698