Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 5 #ifndef UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
| 6 #define UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 6 #define UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 | 144 |
| 145 protected: | 145 protected: |
| 146 // Overridden from views::BubbleDialogDelegateView. | 146 // Overridden from views::BubbleDialogDelegateView. |
| 147 int GetDialogButtons() const override; | 147 int GetDialogButtons() const override; |
| 148 | 148 |
| 149 // Overridden from views::View. | 149 // Overridden from views::View. |
| 150 void ChildPreferredSizeChanged(View* child) override; | 150 void ChildPreferredSizeChanged(View* child) override; |
| 151 void ViewHierarchyChanged( | 151 void ViewHierarchyChanged( |
| 152 const ViewHierarchyChangedDetails& details) override; | 152 const ViewHierarchyChangedDetails& details) override; |
| 153 | 153 |
| 154 void SizeToContents() override; | |
|
James Cook
2017/06/13 20:43:46
nit: move this up to line 148 to put it with the o
sunxd
2017/06/13 22:13:47
Done.
| |
| 155 | |
| 154 private: | 156 private: |
| 155 InitParams params_; | 157 InitParams params_; |
| 156 BoxLayout* layout_; | 158 BoxLayout* layout_; |
| 157 Delegate* delegate_; | 159 Delegate* delegate_; |
| 158 int preferred_width_; | 160 int preferred_width_; |
| 159 // |bubble_border_| and |owned_bubble_border_| point to the same thing, but | 161 // |bubble_border_| and |owned_bubble_border_| point to the same thing, but |
| 160 // the latter ensures we don't leak it before passing off ownership. | 162 // the latter ensures we don't leak it before passing off ownership. |
| 161 BubbleBorder* bubble_border_; | 163 BubbleBorder* bubble_border_; |
| 162 std::unique_ptr<views::BubbleBorder> owned_bubble_border_; | 164 std::unique_ptr<views::BubbleBorder> owned_bubble_border_; |
| 163 std::unique_ptr<internal::TrayBubbleContentMask> bubble_content_mask_; | 165 std::unique_ptr<internal::TrayBubbleContentMask> bubble_content_mask_; |
| 164 bool is_gesture_dragging_; | 166 bool is_gesture_dragging_; |
| 165 | 167 |
| 166 // True once the mouse cursor was actively moved by the user over the bubble. | 168 // True once the mouse cursor was actively moved by the user over the bubble. |
| 167 // Only then the OnMouseExitedView() event will get passed on to listeners. | 169 // Only then the OnMouseExitedView() event will get passed on to listeners. |
| 168 bool mouse_actively_entered_; | 170 bool mouse_actively_entered_; |
| 169 | 171 |
| 170 // Used to find any mouse movements. | 172 // Used to find any mouse movements. |
| 171 std::unique_ptr<MouseWatcher> mouse_watcher_; | 173 std::unique_ptr<MouseWatcher> mouse_watcher_; |
| 172 | 174 |
| 173 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); | 175 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); |
| 174 }; | 176 }; |
| 175 | 177 |
| 176 } // namespace views | 178 } // namespace views |
| 177 | 179 |
| 178 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 180 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
| OLD | NEW |