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

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

Issue 284753002: Add main axis alignment for BoxLayout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove set_spread_blank_space, rename to MainAxisAlignment Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/message_center/views/message_center_view.cc ('k') | ui/views/layout/box_layout.h » ('j') | 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/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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 } 384 }
385 385
386 gfx::Insets TrayBubbleView::GetBorderInsets() const { 386 gfx::Insets TrayBubbleView::GetBorderInsets() const {
387 return bubble_border_->GetInsets(); 387 return bubble_border_->GetInsets();
388 } 388 }
389 389
390 void TrayBubbleView::Init() { 390 void TrayBubbleView::Init() {
391 BoxLayout* layout = new BottomAlignedBoxLayout(this); 391 BoxLayout* layout = new BottomAlignedBoxLayout(this);
392 layout->set_spread_blank_space(true); 392 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL);
393 SetLayoutManager(layout); 393 SetLayoutManager(layout);
394 } 394 }
395 395
396 gfx::Rect TrayBubbleView::GetAnchorRect() { 396 gfx::Rect TrayBubbleView::GetAnchorRect() {
397 if (!delegate_) 397 if (!delegate_)
398 return gfx::Rect(); 398 return gfx::Rect();
399 return delegate_->GetAnchorRect(anchor_widget(), 399 return delegate_->GetAnchorRect(anchor_widget(),
400 params_.anchor_type, 400 params_.anchor_type,
401 params_.anchor_alignment); 401 params_.anchor_alignment);
402 } 402 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 void TrayBubbleView::ViewHierarchyChanged( 500 void TrayBubbleView::ViewHierarchyChanged(
501 const ViewHierarchyChangedDetails& details) { 501 const ViewHierarchyChangedDetails& details) {
502 if (details.is_add && details.child == this) { 502 if (details.is_add && details.child == this) {
503 details.parent->SetPaintToLayer(true); 503 details.parent->SetPaintToLayer(true);
504 details.parent->SetFillsBoundsOpaquely(true); 504 details.parent->SetFillsBoundsOpaquely(true);
505 details.parent->layer()->SetMasksToBounds(true); 505 details.parent->layer()->SetMasksToBounds(true);
506 } 506 }
507 } 507 }
508 508
509 } // namespace views 509 } // namespace views
OLDNEW
« no previous file with comments | « ui/message_center/views/message_center_view.cc ('k') | ui/views/layout/box_layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698