Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: ui/views/bubble/bubble_frame_view.h

Issue 1866403005: Fix rtl shelf overflow bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/bubble/bubble_dialog_delegate.cc ('k') | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void OnThemeChanged() override; 65 void OnThemeChanged() override;
66 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; 66 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
67 67
68 // Overridden from ButtonListener: 68 // Overridden from ButtonListener:
69 void ButtonPressed(Button* sender, const ui::Event& event) override; 69 void ButtonPressed(Button* sender, const ui::Event& event) override;
70 70
71 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder(). 71 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder().
72 BubbleBorder* bubble_border() const { return bubble_border_; } 72 BubbleBorder* bubble_border() const { return bubble_border_; }
73 void SetBubbleBorder(std::unique_ptr<BubbleBorder> border); 73 void SetBubbleBorder(std::unique_ptr<BubbleBorder> border);
74 74
75 void set_mirror_arrow_in_rtl(bool mirror) { mirror_arrow_in_rtl_ = mirror; }
76
75 gfx::Insets content_margins() const { return content_margins_; } 77 gfx::Insets content_margins() const { return content_margins_; }
76 78
77 void SetFootnoteView(View* view); 79 void SetFootnoteView(View* view);
78 80
79 // Given the size of the contents and the rect to point at, returns the bounds 81 // Given the size of the contents and the rect to point at, returns the bounds
80 // of the bubble window. The bubble's arrow location may change if the bubble 82 // of the bubble window. The bubble's arrow location may change if the bubble
81 // does not fit on the monitor and |adjust_if_offscreen| is true. 83 // does not fit on the monitor and |adjust_if_offscreen| is true.
82 gfx::Rect GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, 84 gfx::Rect GetUpdatedWindowBounds(const gfx::Rect& anchor_rect,
83 gfx::Size client_size, 85 gfx::Size client_size,
84 bool adjust_if_offscreen); 86 bool adjust_if_offscreen);
(...skipping 22 matching lines...) Expand all
107 // in the monitor bounds. 109 // in the monitor bounds.
108 void OffsetArrowIfOffScreen(const gfx::Rect& anchor_rect, 110 void OffsetArrowIfOffScreen(const gfx::Rect& anchor_rect,
109 const gfx::Size& client_size); 111 const gfx::Size& client_size);
110 112
111 // Calculates the size needed to accommodate the given client area. 113 // Calculates the size needed to accommodate the given client area.
112 gfx::Size GetSizeForClientSize(const gfx::Size& client_size) const; 114 gfx::Size GetSizeForClientSize(const gfx::Size& client_size) const;
113 115
114 // The bubble border. 116 // The bubble border.
115 BubbleBorder* bubble_border_; 117 BubbleBorder* bubble_border_;
116 118
119 // Adjust insets to account for the mirrored arrow in RTL layout.
msw 2016/04/28 20:16:34 nit: // Used to adjust insets when the arrow is
Greg Levin 2016/04/29 14:32:04 Moved into non_client_view.h, and comment changed
120 bool mirror_arrow_in_rtl_;
121
117 // Margins around the title label. 122 // Margins around the title label.
118 gfx::Insets title_margins_; 123 gfx::Insets title_margins_;
119 124
120 // Margins between the content and the inside of the border, in pixels. 125 // Margins between the content and the inside of the border, in pixels.
121 gfx::Insets content_margins_; 126 gfx::Insets content_margins_;
122 127
123 // The optional title icon, title, and (x) close button. 128 // The optional title icon, title, and (x) close button.
124 views::ImageView* title_icon_; 129 views::ImageView* title_icon_;
125 Label* title_; 130 Label* title_;
126 LabelButton* close_; 131 LabelButton* close_;
127 132
128 // A view to contain the footnote view, if it exists. 133 // A view to contain the footnote view, if it exists.
129 View* footnote_container_; 134 View* footnote_container_;
130 135
131 // Whether the close button was clicked. 136 // Whether the close button was clicked.
132 bool close_button_clicked_; 137 bool close_button_clicked_;
133 138
134 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); 139 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView);
135 }; 140 };
136 141
137 } // namespace views 142 } // namespace views
138 143
139 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ 144 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_dialog_delegate.cc ('k') | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698