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

Side by Side 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: Created 4 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ 5 #ifndef COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_
6 #define COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ 6 #define COMPONENTS_BUBBLE_BUBBLE_MANAGER_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 "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 29 matching lines...) Expand all
40 private: 40 private:
41 DISALLOW_COPY_AND_ASSIGN(BubbleManagerObserver); 41 DISALLOW_COPY_AND_ASSIGN(BubbleManagerObserver);
42 }; 42 };
43 43
44 // Should be instantiated on the UI thread. 44 // Should be instantiated on the UI thread.
45 BubbleManager(); 45 BubbleManager();
46 virtual ~BubbleManager(); 46 virtual ~BubbleManager();
47 47
48 // Shows a specific bubble and returns a reference to it. 48 // Shows a specific bubble and returns a reference to it.
49 // This reference should be used through the BubbleManager. 49 // This reference should be used through the BubbleManager.
50 // Unless the BubbleDelegate uses ShouldClose to override the default, the
51 // BubbleDelegate will be destroyed before any RenderFrameHost is destroyed.
hcarmona 2016/01/11 19:07:22 Same concern as above about this being very specif
50 BubbleReference ShowBubble(scoped_ptr<BubbleDelegate> bubble); 52 BubbleReference ShowBubble(scoped_ptr<BubbleDelegate> bubble);
51 53
52 // Notify a bubble of an event that might trigger close. 54 // Notify a bubble of an event that might trigger close.
53 // Returns true if the bubble was actually closed. 55 // Returns true if the bubble was actually closed.
54 bool CloseBubble(BubbleReference bubble, BubbleCloseReason reason); 56 bool CloseBubble(BubbleReference bubble, BubbleCloseReason reason);
55 57
56 // Notify all bubbles of an event that might trigger close. 58 // Notify all bubbles of an event that might trigger close.
57 void CloseAllBubbles(BubbleCloseReason reason); 59 void CloseAllBubbles(BubbleCloseReason reason);
58 60
59 // Notify all bubbles that their anchor or parent may have changed. 61 // Notify all bubbles that their anchor or parent may have changed.
(...skipping 30 matching lines...) Expand all
90 // Determines what happens to a bubble when |ShowBubble| is called. 92 // Determines what happens to a bubble when |ShowBubble| is called.
91 ManagerState manager_state_; 93 ManagerState manager_state_;
92 94
93 // The bubbles that are being managed. 95 // The bubbles that are being managed.
94 ScopedVector<BubbleController> controllers_; 96 ScopedVector<BubbleController> controllers_;
95 97
96 DISALLOW_COPY_AND_ASSIGN(BubbleManager); 98 DISALLOW_COPY_AND_ASSIGN(BubbleManager);
97 }; 99 };
98 100
99 #endif // COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ 101 #endif // COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698