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

Side by Side Diff: components/bubble/bubble_delegate.h

Issue 1310483003: Add ability for a BubbleReference to update the BubbleUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bm-reference-own-file.gitbr
Patch Set: Add UI thread checks to controller Created 5 years, 3 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 | « components/bubble/bubble_controller.cc ('k') | components/bubble/bubble_delegate.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 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_DELEGATE_H_ 5 #ifndef COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
6 #define COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_ 6 #define COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "components/bubble/bubble_close_reason.h" 9 #include "components/bubble/bubble_close_reason.h"
10 10
11 class BubbleUI; 11 class BubbleUi;
12 12
13 // Inherit from this class to define a bubble. A bubble is a small transient UI 13 // Inherit from this class to define a bubble. A bubble is a small transient UI
14 // surface anchored to a parent window. Most bubbles are dismissed when they 14 // surface anchored to a parent window. Most bubbles are dismissed when they
15 // lose focus. 15 // lose focus.
16 class BubbleDelegate { 16 class BubbleDelegate {
17 public: 17 public:
18 BubbleDelegate(); 18 BubbleDelegate();
19 virtual ~BubbleDelegate(); 19 virtual ~BubbleDelegate();
20 20
21 // Called by BubbleController to notify a bubble of an event that the bubble 21 // Called by BubbleController to notify a bubble of an event that the bubble
22 // might want to close on. Return true if the bubble should close for the 22 // might want to close on. Return true if the bubble should close for the
23 // specified reason. 23 // specified reason.
24 virtual bool ShouldClose(BubbleCloseReason reason); 24 virtual bool ShouldClose(BubbleCloseReason reason);
25 25
26 // Called by BubbleController to build the UI that will represent this bubble. 26 // Called by BubbleController to build the UI that will represent this bubble.
27 // BubbleDelegate should not keep a reference to this newly created UI. 27 // BubbleDelegate should not keep a reference to this newly created UI.
28 virtual scoped_ptr<BubbleUI> BuildBubbleUI() = 0; 28 virtual scoped_ptr<BubbleUi> BuildBubbleUi() = 0;
29
30 // Called to update an existing UI. This is the same BubbleUi that was created
31 // in |BuildBubbleUi|.
32 // Return true to indicate the UI was updated.
33 virtual bool UpdateBubbleUi(BubbleUi* bubble_ui);
29 34
30 private: 35 private:
31 DISALLOW_COPY_AND_ASSIGN(BubbleDelegate); 36 DISALLOW_COPY_AND_ASSIGN(BubbleDelegate);
32 }; 37 };
33 38
34 #endif // COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_ 39 #endif // COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/bubble/bubble_controller.cc ('k') | components/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698