| 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/tooltip_icon.h" | 5 #include "chrome/browser/ui/views/autofill/tooltip_icon.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
| 9 #include "chrome/browser/ui/views/autofill/info_bubble.h" | 9 #include "chrome/browser/ui/views/autofill/info_bubble.h" |
| 10 #include "grit/theme_resources.h" | 10 #include "grit/theme_resources.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 origin.x(), | 27 origin.x(), |
| 28 local_bounds.bottom() - (origin.y() + pref_size.height()), | 28 local_bounds.bottom() - (origin.y() + pref_size.height()), |
| 29 local_bounds.right() - (origin.x() + pref_size.width())); | 29 local_bounds.right() - (origin.x() + pref_size.width())); |
| 30 } | 30 } |
| 31 | 31 |
| 32 // An info bubble with some extra positioning magic for tooltip icons. | 32 // An info bubble with some extra positioning magic for tooltip icons. |
| 33 class TooltipBubble : public InfoBubble { | 33 class TooltipBubble : public InfoBubble { |
| 34 public: | 34 public: |
| 35 TooltipBubble(views::View* anchor, const base::string16& message) | 35 TooltipBubble(views::View* anchor, const base::string16& message) |
| 36 : InfoBubble(anchor, message) {} | 36 : InfoBubble(anchor, message) {} |
| 37 virtual ~TooltipBubble() {} | 37 ~TooltipBubble() override {} |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 // InfoBubble: | 40 // InfoBubble: |
| 41 virtual gfx::Rect GetAnchorRect() const override { | 41 gfx::Rect GetAnchorRect() const override { |
| 42 gfx::Rect bounds = views::BubbleDelegateView::GetAnchorRect(); | 42 gfx::Rect bounds = views::BubbleDelegateView::GetAnchorRect(); |
| 43 bounds.Inset(GetPreferredInsets(anchor())); | 43 bounds.Inset(GetPreferredInsets(anchor())); |
| 44 return bounds; | 44 return bounds; |
| 45 } | 45 } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 DISALLOW_COPY_AND_ASSIGN(TooltipBubble); | 48 DISALLOW_COPY_AND_ASSIGN(TooltipBubble); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 void TooltipIcon::OnWidgetDestroyed(views::Widget* widget) { | 136 void TooltipIcon::OnWidgetDestroyed(views::Widget* widget) { |
| 137 observer_.Remove(widget); | 137 observer_.Remove(widget); |
| 138 | 138 |
| 139 ChangeImageTo(IDR_AUTOFILL_TOOLTIP_ICON); | 139 ChangeImageTo(IDR_AUTOFILL_TOOLTIP_ICON); |
| 140 mouse_watcher_.reset(); | 140 mouse_watcher_.reset(); |
| 141 bubble_ = NULL; | 141 bubble_ = NULL; |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace autofill | 144 } // namespace autofill |
| OLD | NEW |