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

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

Issue 454173002: Fixed BubbleBorder sizing problems & added unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Combined test fixtures and rewrote tests to be more easily maintained. Created 6 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
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/tray_bubble_view.h" 5 #include "ui/views/bubble/tray_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 if (preferred_width_ == width) 374 if (preferred_width_ == width)
375 return; 375 return;
376 preferred_width_ = width; 376 preferred_width_ = width;
377 if (GetWidget()) 377 if (GetWidget())
378 SizeToContents(); 378 SizeToContents();
379 } 379 }
380 380
381 void TrayBubbleView::SetArrowPaintType( 381 void TrayBubbleView::SetArrowPaintType(
382 views::BubbleBorder::ArrowPaintType paint_type) { 382 views::BubbleBorder::ArrowPaintType paint_type) {
383 bubble_border_->set_paint_arrow(paint_type); 383 bubble_border_->set_paint_arrow(paint_type);
384 UpdateBubble();
384 } 385 }
385 386
386 gfx::Insets TrayBubbleView::GetBorderInsets() const { 387 gfx::Insets TrayBubbleView::GetBorderInsets() const {
387 return bubble_border_->GetInsets(); 388 return bubble_border_->GetInsets();
388 } 389 }
389 390
390 void TrayBubbleView::Init() { 391 void TrayBubbleView::Init() {
391 BoxLayout* layout = new BottomAlignedBoxLayout(this); 392 BoxLayout* layout = new BottomAlignedBoxLayout(this);
392 layout->SetDefaultFlex(1); 393 layout->SetDefaultFlex(1);
393 SetLayoutManager(layout); 394 SetLayoutManager(layout);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 void TrayBubbleView::ViewHierarchyChanged( 501 void TrayBubbleView::ViewHierarchyChanged(
501 const ViewHierarchyChangedDetails& details) { 502 const ViewHierarchyChangedDetails& details) {
502 if (details.is_add && details.child == this) { 503 if (details.is_add && details.child == this) {
503 details.parent->SetPaintToLayer(true); 504 details.parent->SetPaintToLayer(true);
504 details.parent->SetFillsBoundsOpaquely(true); 505 details.parent->SetFillsBoundsOpaquely(true);
505 details.parent->layer()->SetMasksToBounds(true); 506 details.parent->layer()->SetMasksToBounds(true);
506 } 507 }
507 } 508 }
508 509
509 } // namespace views 510 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698