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

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

Issue 1876553002: mash: Close system tray bubble on click outside its bounds, part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 8 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
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_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 "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/views/bubble/bubble_delegate.h" 10 #include "ui/views/bubble/bubble_delegate.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 int min_width, 96 int min_width,
97 int max_width); 97 int max_width);
98 InitParams(const InitParams& other); 98 InitParams(const InitParams& other);
99 AnchorType anchor_type; 99 AnchorType anchor_type;
100 AnchorAlignment anchor_alignment; 100 AnchorAlignment anchor_alignment;
101 int min_width; 101 int min_width;
102 int max_width; 102 int max_width;
103 int max_height; 103 int max_height;
104 bool can_activate; 104 bool can_activate;
105 bool close_on_deactivate; 105 bool close_on_deactivate;
106 // When true the bubble starts event capture when it opens and closes itself
107 // on mouse events outside its bounds. Used on mus. Can be combined with
108 // close_on_deactivate. Defaults to false.
109 bool close_via_capture;
106 SkColor arrow_color; 110 SkColor arrow_color;
107 bool first_item_has_no_margin; 111 bool first_item_has_no_margin;
108 views::BubbleBorder::Arrow arrow; 112 views::BubbleBorder::Arrow arrow;
109 int arrow_offset; 113 int arrow_offset;
110 views::BubbleBorder::ArrowPaintType arrow_paint_type; 114 views::BubbleBorder::ArrowPaintType arrow_paint_type;
111 views::BubbleBorder::Shadow shadow; 115 views::BubbleBorder::Shadow shadow;
112 views::BubbleBorder::BubbleAlignment arrow_alignment; 116 views::BubbleBorder::BubbleAlignment arrow_alignment;
113 }; 117 };
114 118
115 // Constructs and returns a TrayBubbleView. init_params may be modified. 119 // Constructs and returns a TrayBubbleView. init_params may be modified.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 bool WidgetHasHitTestMask() const override; 158 bool WidgetHasHitTestMask() const override;
155 void GetWidgetHitTestMask(gfx::Path* mask) const override; 159 void GetWidgetHitTestMask(gfx::Path* mask) const override;
156 160
157 // Overridden from views::BubbleDelegateView. 161 // Overridden from views::BubbleDelegateView.
158 gfx::Rect GetAnchorRect() const override; 162 gfx::Rect GetAnchorRect() const override;
159 163
160 // Overridden from views::View. 164 // Overridden from views::View.
161 gfx::Size GetPreferredSize() const override; 165 gfx::Size GetPreferredSize() const override;
162 gfx::Size GetMaximumSize() const override; 166 gfx::Size GetMaximumSize() const override;
163 int GetHeightForWidth(int width) const override; 167 int GetHeightForWidth(int width) const override;
168 bool OnMousePressed(const ui::MouseEvent& event) override;
169 void OnMouseCaptureLost() override;
164 void OnMouseEntered(const ui::MouseEvent& event) override; 170 void OnMouseEntered(const ui::MouseEvent& event) override;
165 void OnMouseExited(const ui::MouseEvent& event) override; 171 void OnMouseExited(const ui::MouseEvent& event) override;
166 void GetAccessibleState(ui::AXViewState* state) override; 172 void GetAccessibleState(ui::AXViewState* state) override;
167 173
168 // Overridden from MouseWatcherListener 174 // Overridden from MouseWatcherListener
169 void MouseMovedOutOfHost() override; 175 void MouseMovedOutOfHost() override;
170 176
171 protected: 177 protected:
172 TrayBubbleView(gfx::NativeView parent_window, 178 TrayBubbleView(gfx::NativeView parent_window,
173 views::View* anchor, 179 views::View* anchor,
(...skipping 25 matching lines...) Expand all
199 205
200 // Used to find any mouse movements. 206 // Used to find any mouse movements.
201 scoped_ptr<MouseWatcher> mouse_watcher_; 207 scoped_ptr<MouseWatcher> mouse_watcher_;
202 208
203 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); 209 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView);
204 }; 210 };
205 211
206 } // namespace views 212 } // namespace views
207 213
208 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ 214 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698