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

Unified Diff: components/bubble/bubble_manager.h

Issue 1572743002: Make sure bubbles in Views default to close before their RenderFrameHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Clean up Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/bubble/bubble_manager.h
diff --git a/components/bubble/bubble_manager.h b/components/bubble/bubble_manager.h
index 3e2d838f8902dc708ad4482302665377f02fe069..e1a1dfb5f2c9dbf7e53534619800a94a14248c8c 100644
--- a/components/bubble/bubble_manager.h
+++ b/components/bubble/bubble_manager.h
@@ -15,6 +15,10 @@
class BubbleDelegate;
+namespace content {
+class RenderFrameHost;
+}
+
// Inherit from BubbleManager to show, update, and close bubbles.
// Any class that inherits from BubbleManager should capture any events that
// should dismiss a bubble or update its anchor point.
@@ -69,6 +73,10 @@ class BubbleManager {
// Will close any open bubbles and prevent new ones from being shown.
void FinalizePendingRequests();
+ // Closes bubbles that declare |frame| as their owner, with
+ // a reason of BUBBLE_CLOSE_FRAME_DESTROYED.
+ void CloseBubblesOwnedBy(const content::RenderFrameHost* frame);
+
private:
enum ManagerState {
SHOW_BUBBLES,
@@ -76,10 +84,11 @@ class BubbleManager {
ITERATING_BUBBLES,
};
- // All bubbles will get a close event for the specified |reason| if |match| is
- // nullptr, otherwise only the bubble held by |match| will get a close event.
- // Any bubble that is closed will also be deleted.
+ // All matching bubbles will get a close event for the specified |reason|. Any
+ // bubble that is closed will also be deleted. Bubbles match if 1) match is
+ // null or it refers to the bubble, and 2) frame is null or owns the bubble.
bool CloseAllMatchingBubbles(BubbleController* match,
hcarmona 2016/02/05 22:48:24 Can we rename these params to |bubble_match| and |
Peter Kasting 2016/02/06 04:13:08 I think |bubble| and |owner| would be better names
Jeffrey Yasskin 2016/02/08 23:59:09 I also like |bubble| and |owner|.
hcarmona 2016/02/09 00:31:05 |bubble| and |owner| are fine.
+ const content::RenderFrameHost* frame,
BubbleCloseReason reason);
base::ObserverList<BubbleManagerObserver> observers_;

Powered by Google App Engine
This is Rietveld 408576698