| 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_BUBBLE_FRAME_VIEW_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
| 6 #define UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 Button* GetCloseButtonForTest() { return close_; } | 89 Button* GetCloseButtonForTest() { return close_; } |
| 90 | 90 |
| 91 protected: | 91 protected: |
| 92 // Returns the available screen bounds if the frame were to show in |rect|. | 92 // Returns the available screen bounds if the frame were to show in |rect|. |
| 93 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const; | 93 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const; |
| 94 | 94 |
| 95 bool IsCloseButtonVisible() const; | 95 bool IsCloseButtonVisible() const; |
| 96 gfx::Rect GetCloseButtonMirroredBounds() const; | 96 gfx::Rect GetCloseButtonMirroredBounds() const; |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 class FootnoteContainerView; |
| 99 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView); | 100 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView); |
| 100 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, RemoveFootnoteView); | 101 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, RemoveFootnoteView); |
| 102 FRIEND_TEST_ALL_PREFIXES( |
| 103 BubbleFrameViewTest, |
| 104 FootnoteContainerViewShouldMatchVisibilityOfFirstChild); |
| 101 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons); | 105 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons); |
| 102 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateTest, CloseMethods); | 106 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateTest, CloseMethods); |
| 103 | 107 |
| 104 // Mirrors the bubble's arrow location on the |vertical| or horizontal axis, | 108 // Mirrors the bubble's arrow location on the |vertical| or horizontal axis, |
| 105 // if the generated window bounds don't fit in the monitor bounds. | 109 // if the generated window bounds don't fit in the monitor bounds. |
| 106 void MirrorArrowIfOffScreen(bool vertical, | 110 void MirrorArrowIfOffScreen(bool vertical, |
| 107 const gfx::Rect& anchor_rect, | 111 const gfx::Rect& anchor_rect, |
| 108 const gfx::Size& client_size); | 112 const gfx::Size& client_size); |
| 109 | 113 |
| 110 // Adjust the bubble's arrow offsets if the generated window bounds don't fit | 114 // Adjust the bubble's arrow offsets if the generated window bounds don't fit |
| (...skipping 12 matching lines...) Expand all Loading... |
| 123 | 127 |
| 124 // Margins between the content and the inside of the border, in pixels. | 128 // Margins between the content and the inside of the border, in pixels. |
| 125 gfx::Insets content_margins_; | 129 gfx::Insets content_margins_; |
| 126 | 130 |
| 127 // The optional title icon, title, and (x) close button. | 131 // The optional title icon, title, and (x) close button. |
| 128 views::ImageView* title_icon_; | 132 views::ImageView* title_icon_; |
| 129 Label* title_; | 133 Label* title_; |
| 130 Button* close_; | 134 Button* close_; |
| 131 | 135 |
| 132 // A view to contain the footnote view, if it exists. | 136 // A view to contain the footnote view, if it exists. |
| 133 View* footnote_container_; | 137 FootnoteContainerView* footnote_container_; |
| 134 | 138 |
| 135 // Whether the close button was clicked. | 139 // Whether the close button was clicked. |
| 136 bool close_button_clicked_; | 140 bool close_button_clicked_; |
| 137 | 141 |
| 138 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); | 142 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); |
| 139 }; | 143 }; |
| 140 | 144 |
| 141 } // namespace views | 145 } // namespace views |
| 142 | 146 |
| 143 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 147 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
| OLD | NEW |