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

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

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month 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 | « ui/views/border_unittest.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('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/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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 return; 394 return;
395 395
396 DCHECK(!footnote_container_); 396 DCHECK(!footnote_container_);
397 footnote_container_ = new views::View(); 397 footnote_container_ = new views::View();
398 footnote_container_->SetLayoutManager( 398 footnote_container_->SetLayoutManager(
399 new BoxLayout(BoxLayout::kVertical, content_margins_.left(), 399 new BoxLayout(BoxLayout::kVertical, content_margins_.left(),
400 content_margins_.top(), 0)); 400 content_margins_.top(), 0));
401 footnote_container_->set_background( 401 footnote_container_->set_background(
402 Background::CreateSolidBackground(kFootnoteBackgroundColor)); 402 Background::CreateSolidBackground(kFootnoteBackgroundColor));
403 footnote_container_->SetBorder( 403 footnote_container_->SetBorder(
404 Border::CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor)); 404 CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor));
405 footnote_container_->AddChildView(view); 405 footnote_container_->AddChildView(view);
406 AddChildView(footnote_container_); 406 AddChildView(footnote_container_);
407 } 407 }
408 408
409 gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, 409 gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect,
410 gfx::Size client_size, 410 gfx::Size client_size,
411 bool adjust_if_offscreen) { 411 bool adjust_if_offscreen) {
412 gfx::Size size(GetSizeForClientSize(client_size)); 412 gfx::Size size(GetSizeForClientSize(client_size));
413 413
414 const BubbleBorder::Arrow arrow = bubble_border_->arrow(); 414 const BubbleBorder::Arrow arrow = bubble_border_->arrow();
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 size.Enlarge(client_insets.width(), client_insets.height()); 528 size.Enlarge(client_insets.width(), client_insets.height());
529 size.SetToMax(gfx::Size(title_bar_width, 0)); 529 size.SetToMax(gfx::Size(title_bar_width, 0));
530 530
531 if (footnote_container_) 531 if (footnote_container_)
532 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); 532 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width()));
533 533
534 return size; 534 return size;
535 } 535 }
536 536
537 } // namespace views 537 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/border_unittest.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698