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

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

Issue 1923143003: Implement the 2016Q2 Translate UI designe spec out in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix namespace in .h and other minor review comments 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
« ui/resources/ui_resources.grd ('K') | « ui/resources/ui_resources.grd ('k') | no next file » | 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"
11 #include "ui/gfx/geometry/insets.h" 11 #include "ui/gfx/geometry/insets.h"
12 #include "ui/views/controls/button/button.h" 12 #include "ui/views/controls/button/button.h"
13 #include "ui/views/window/non_client_view.h" 13 #include "ui/views/window/non_client_view.h"
14 14
15 namespace gfx { 15 namespace gfx {
16 class FontList; 16 class FontList;
17 } 17 }
18 18
19 FORWARD_DECLARE_TEST(TranslateBubbleViewTest, CloseButtonIn2016Q2UI);
20
19 namespace views { 21 namespace views {
20 22
21 class Label; 23 class Label;
22 class LabelButton; 24 class LabelButton;
23 class BubbleBorder; 25 class BubbleBorder;
24 class ImageView; 26 class ImageView;
25 27
26 // The non-client frame view of bubble-styled widgets. 28 // The non-client frame view of bubble-styled widgets.
27 class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, 29 class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
28 public ButtonListener { 30 public ButtonListener {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Returns the available screen bounds if the frame were to show in |rect|. 91 // Returns the available screen bounds if the frame were to show in |rect|.
90 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const; 92 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const;
91 93
92 bool IsCloseButtonVisible() const; 94 bool IsCloseButtonVisible() const;
93 gfx::Rect GetCloseButtonMirroredBounds() const; 95 gfx::Rect GetCloseButtonMirroredBounds() const;
94 96
95 private: 97 private:
96 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView); 98 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView);
97 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons); 99 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons);
98 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateTest, CloseMethods); 100 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateTest, CloseMethods);
101 FRIEND_TEST_ALL_PREFIXES(::TranslateBubbleViewTest, CloseButtonIn2016Q2UI);
msw 2016/04/29 20:00:03 Can you avoid this and instead fire an [Escape] ke
ftang 2016/04/29 22:37:03 no, I cannot.
msw 2016/04/29 23:43:40 Please explain why; it's unfortunate if we need to
99 102
100 // Mirrors the bubble's arrow location on the |vertical| or horizontal axis, 103 // Mirrors the bubble's arrow location on the |vertical| or horizontal axis,
101 // if the generated window bounds don't fit in the monitor bounds. 104 // if the generated window bounds don't fit in the monitor bounds.
102 void MirrorArrowIfOffScreen(bool vertical, 105 void MirrorArrowIfOffScreen(bool vertical,
103 const gfx::Rect& anchor_rect, 106 const gfx::Rect& anchor_rect,
104 const gfx::Size& client_size); 107 const gfx::Size& client_size);
105 108
106 // Adjust the bubble's arrow offsets if the generated window bounds don't fit 109 // Adjust the bubble's arrow offsets if the generated window bounds don't fit
107 // in the monitor bounds. 110 // in the monitor bounds.
108 void OffsetArrowIfOffScreen(const gfx::Rect& anchor_rect, 111 void OffsetArrowIfOffScreen(const gfx::Rect& anchor_rect,
(...skipping 21 matching lines...) Expand all
130 133
131 // Whether the close button was clicked. 134 // Whether the close button was clicked.
132 bool close_button_clicked_; 135 bool close_button_clicked_;
133 136
134 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); 137 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView);
135 }; 138 };
136 139
137 } // namespace views 140 } // namespace views
138 141
139 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ 142 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_
OLDNEW
« ui/resources/ui_resources.grd ('K') | « ui/resources/ui_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698