| 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 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_TOOLTIP_ICON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_TOOLTIP_ICON_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_TOOLTIP_ICON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_TOOLTIP_ICON_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 static const char kViewClassName[]; | 29 static const char kViewClassName[]; |
| 30 | 30 |
| 31 explicit TooltipIcon(const base::string16& tooltip); | 31 explicit TooltipIcon(const base::string16& tooltip); |
| 32 ~TooltipIcon() override; | 32 ~TooltipIcon() override; |
| 33 | 33 |
| 34 // views::ImageView: | 34 // views::ImageView: |
| 35 const char* GetClassName() const override; | 35 const char* GetClassName() const override; |
| 36 void OnMouseEntered(const ui::MouseEvent& event) override; | 36 void OnMouseEntered(const ui::MouseEvent& event) override; |
| 37 void OnMouseExited(const ui::MouseEvent& event) override; | 37 void OnMouseExited(const ui::MouseEvent& event) override; |
| 38 void OnGestureEvent(ui::GestureEvent* event) override; | 38 void OnGestureEvent(ui::GestureEvent* event) override; |
| 39 void GetAccessibleState(ui::AXViewState* state) override; | 39 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 40 | 40 |
| 41 // views::MouseWatcherListener: | 41 // views::MouseWatcherListener: |
| 42 void MouseMovedOutOfHost() override; | 42 void MouseMovedOutOfHost() override; |
| 43 | 43 |
| 44 // views::WidgetObserver: | 44 // views::WidgetObserver: |
| 45 void OnWidgetDestroyed(views::Widget* widget) override; | 45 void OnWidgetDestroyed(views::Widget* widget) override; |
| 46 | 46 |
| 47 void set_bubble_arrow(views::BubbleBorder::Arrow arrow) { | 47 void set_bubble_arrow(views::BubbleBorder::Arrow arrow) { |
| 48 bubble_arrow_ = arrow; | 48 bubble_arrow_ = arrow; |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // Changes the color to reflect the hover state. | 52 // Changes the color to reflect the hover node_data. |
| 53 void SetDrawAsHovered(bool hovered); | 53 void SetDrawAsHovered(bool hovered); |
| 54 | 54 |
| 55 // Creates and shows |bubble_|. If |bubble_| already exists, just cancels a | 55 // Creates and shows |bubble_|. If |bubble_| already exists, just cancels a |
| 56 // potential close timer. | 56 // potential close timer. |
| 57 void ShowBubble(); | 57 void ShowBubble(); |
| 58 | 58 |
| 59 // Hides |bubble_| if necessary. | 59 // Hides |bubble_| if necessary. |
| 60 void HideBubble(); | 60 void HideBubble(); |
| 61 | 61 |
| 62 // The text to show in a bubble when hovered. | 62 // The text to show in a bubble when hovered. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 78 std::unique_ptr<views::MouseWatcher> mouse_watcher_; | 78 std::unique_ptr<views::MouseWatcher> mouse_watcher_; |
| 79 | 79 |
| 80 ScopedObserver<views::Widget, TooltipIcon> observer_; | 80 ScopedObserver<views::Widget, TooltipIcon> observer_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(TooltipIcon); | 82 DISALLOW_COPY_AND_ASSIGN(TooltipIcon); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace autofill | 85 } // namespace autofill |
| 86 | 86 |
| 87 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_TOOLTIP_ICON_H_ | 87 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_TOOLTIP_ICON_H_ |
| OLD | NEW |