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

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

Issue 1251633002: Add BubbleManager to manage bubbles and ChromeBubbleManager for events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn nit 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_close_reason.h ('k') | components/bubble/bubble_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H_
6 #define COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "components/bubble/bubble_close_reason.h"
11
12 class BubbleDelegate;
13 class BubbleManager;
14 class BubbleUI;
15
16 // BubbleController is responsible for the lifetime of the delegate and its UI.
17 class BubbleController : public base::SupportsWeakPtr<BubbleController> {
18 public:
19 explicit BubbleController(BubbleManager* manager,
20 scoped_ptr<BubbleDelegate> delegate);
21 virtual ~BubbleController();
22
23 // Calls CloseBubble on the associated BubbleManager.
24 bool CloseBubble(BubbleCloseReason reason);
25
26 private:
27 friend class BubbleManager;
28
29 // Creates and shows the UI for the delegate.
30 void Show();
31
32 // Notifies the bubble UI that it should update its anchor location.
33 // Important when there's a UI change (ex: fullscreen transition).
34 void UpdateAnchorPosition();
35
36 // Cleans up the delegate and its UI if it closed.
37 // Returns true if the bubble was closed.
38 bool ShouldClose(BubbleCloseReason reason);
39
40 BubbleManager* manager_;
41 scoped_ptr<BubbleDelegate> delegate_;
42 scoped_ptr<BubbleUI> bubble_ui_;
43
44 DISALLOW_COPY_AND_ASSIGN(BubbleController);
45 };
46
47 #endif // COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « components/bubble/bubble_close_reason.h ('k') | components/bubble/bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698