OLD | NEW |
---|---|
(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 CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ | |
6 #define CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ | |
7 | |
8 #import <Cocoa/Cocoa.h> | |
9 | |
10 #include "base/macros.h" | |
11 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h" | |
12 #include "components/bubble/bubble_ui.h" | |
13 | |
14 class Browser; | |
15 class ChooserBubbleDelegate; | |
16 @class ChooserBubbleUiController; | |
17 | |
18 // ChooserBubbleUiCocoa implements a chooser-based permission model, | |
19 // it uses table view to show a list of options for user to grant | |
20 // permission. It can be used by WebUsb, WebBluetooth. | |
palmer
2015/12/10 23:26:10
Nits: The first sentence should have the 2 clauses
juncai
2015/12/11 20:39:46
Done.
| |
21 class ChooserBubbleUiCocoa : public BubbleUi, | |
22 public ChooserBubbleDelegate::Observer { | |
23 public: | |
24 ChooserBubbleUiCocoa(Browser* browser, | |
25 ChooserBubbleDelegate* chooser_bubble_delegate); | |
26 ~ChooserBubbleUiCocoa() override; | |
27 | |
28 // BubbleUi: | |
29 void Show(BubbleReference bubble_reference) override; | |
30 void Close() override; | |
31 void UpdateAnchorPosition() override; | |
32 | |
33 // ChooserBubbleDelegate::Observer: | |
34 void OnOptionsInitialized() override; | |
35 void OnOptionAdded(int index) override; | |
36 void OnOptionRemoved(int index) override; | |
37 | |
38 // Called when |chooser_bubble_ui_controller_| is closing. | |
palmer
2015/12/10 23:26:10
Passive voice/leaving out the agent is confusing h
juncai
2015/12/11 20:39:46
ChooserBubbleUiController's windowWillClose calls
| |
39 void OnBubbleClosing(); | |
40 | |
41 private: | |
42 Browser* browser_; // Weak. | |
43 ChooserBubbleDelegate* chooser_bubble_delegate_; // Weak. | |
44 // Cocoa-side chooser bubble UI controller. Weak, as it will close itself. | |
45 ChooserBubbleUiController* chooser_bubble_ui_controller_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa); | |
48 }; | |
49 | |
50 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ | |
OLD | NEW |