| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/autofill/info_bubble.h" | 5 #include "chrome/browser/ui/views/autofill/info_bubble.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "ui/gfx/point.h" | 8 #include "ui/gfx/point.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 align_to_anchor_edge_(false), | 58 align_to_anchor_edge_(false), |
| 59 preferred_width_(233), | 59 preferred_width_(233), |
| 60 show_above_anchor_(false) { | 60 show_above_anchor_(false) { |
| 61 DCHECK(anchor_); | 61 DCHECK(anchor_); |
| 62 SetAnchorView(anchor_); | 62 SetAnchorView(anchor_); |
| 63 | 63 |
| 64 set_margins(gfx::Insets(kInfoBubbleVerticalMargin, | 64 set_margins(gfx::Insets(kInfoBubbleVerticalMargin, |
| 65 kInfoBubbleHorizontalMargin, | 65 kInfoBubbleHorizontalMargin, |
| 66 kInfoBubbleVerticalMargin, | 66 kInfoBubbleVerticalMargin, |
| 67 kInfoBubbleHorizontalMargin)); | 67 kInfoBubbleHorizontalMargin)); |
| 68 set_use_focusless(true); | 68 set_can_activate(false); |
| 69 | 69 |
| 70 SetLayoutManager(new views::FillLayout); | 70 SetLayoutManager(new views::FillLayout); |
| 71 views::Label* label = new views::Label(message); | 71 views::Label* label = new views::Label(message); |
| 72 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 72 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 73 label->SetMultiLine(true); | 73 label->SetMultiLine(true); |
| 74 AddChildView(label); | 74 AddChildView(label); |
| 75 } | 75 } |
| 76 | 76 |
| 77 InfoBubble::~InfoBubble() {} | 77 InfoBubble::~InfoBubble() {} |
| 78 | 78 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 void InfoBubble::OnWidgetBoundsChanged(views::Widget* widget, | 142 void InfoBubble::OnWidgetBoundsChanged(views::Widget* widget, |
| 143 const gfx::Rect& new_bounds) { | 143 const gfx::Rect& new_bounds) { |
| 144 views::BubbleDelegateView::OnWidgetBoundsChanged(widget, new_bounds); | 144 views::BubbleDelegateView::OnWidgetBoundsChanged(widget, new_bounds); |
| 145 if (anchor_widget() == widget) | 145 if (anchor_widget() == widget) |
| 146 frame_->set_available_bounds(widget->GetWindowBoundsInScreen()); | 146 frame_->set_available_bounds(widget->GetWindowBoundsInScreen()); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace autofill | 149 } // namespace autofill |
| OLD | NEW |