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

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

Issue 2803293002: Create Bookmark Footnote desktop iOS promotion (Closed)
Patch Set: Add footnote promotion Created 3 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
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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 new BoxLayout(BoxLayout::kVertical, content_margins_.left(), 401 new BoxLayout(BoxLayout::kVertical, content_margins_.left(),
402 content_margins_.top(), 0)); 402 content_margins_.top(), 0));
403 footnote_container_->set_background( 403 footnote_container_->set_background(
404 Background::CreateSolidBackground(kFootnoteBackgroundColor)); 404 Background::CreateSolidBackground(kFootnoteBackgroundColor));
405 footnote_container_->SetBorder( 405 footnote_container_->SetBorder(
406 CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor)); 406 CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor));
407 footnote_container_->AddChildView(view); 407 footnote_container_->AddChildView(view);
408 AddChildView(footnote_container_); 408 AddChildView(footnote_container_);
409 } 409 }
410 410
411 void BubbleFrameView::RemoveFootnoteView() {
sky 2017/05/17 16:00:41 Instead of an explicit function like this, overrid
mrefaat 2017/05/17 19:44:56 I remember that we talked about that and you said
sky 2017/05/18 02:55:38 Sorry if I mislead you. It's a similar argument to
mrefaat1 2017/05/23 22:15:34 Done.
412 if (!footnote_container_)
413 return;
414
415 RemoveChildView(footnote_container_);
416 footnote_container_->RemoveAllChildViews(true);
417 delete footnote_container_;
418 footnote_container_ = nullptr;
419 }
420
411 gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, 421 gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect,
412 const gfx::Size& client_size, 422 const gfx::Size& client_size,
413 bool adjust_if_offscreen) { 423 bool adjust_if_offscreen) {
414 gfx::Size size(GetSizeForClientSize(client_size)); 424 gfx::Size size(GetSizeForClientSize(client_size));
415 425
416 const BubbleBorder::Arrow arrow = bubble_border_->arrow(); 426 const BubbleBorder::Arrow arrow = bubble_border_->arrow();
417 if (adjust_if_offscreen && BubbleBorder::has_arrow(arrow)) { 427 if (adjust_if_offscreen && BubbleBorder::has_arrow(arrow)) {
418 // Try to mirror the anchoring if the bubble does not fit on the screen. 428 // Try to mirror the anchoring if the bubble does not fit on the screen.
419 if (!bubble_border_->is_arrow_at_center(arrow)) { 429 if (!bubble_border_->is_arrow_at_center(arrow)) {
420 MirrorArrowIfOffScreen(true, anchor_rect, size); 430 MirrorArrowIfOffScreen(true, anchor_rect, size);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 545
536 DialogDelegate* dialog_delegate = 546 DialogDelegate* dialog_delegate =
537 GetWidget()->widget_delegate()->AsDialogDelegate(); 547 GetWidget()->widget_delegate()->AsDialogDelegate();
538 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) 548 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth())
539 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); 549 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width()));
540 550
541 return size; 551 return size;
542 } 552 }
543 553
544 } // namespace views 554 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698