| 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 <memory> | |
| 11 | |
| 12 #include "base/macros.h" | |
| 13 #include "components/bubble/bubble_ui.h" | |
| 14 | |
| 15 class Browser; | |
| 16 @class ChooserBubbleUiController; | |
| 17 class ChooserController; | |
| 18 | |
| 19 // ChooserBubbleUiCocoa implements a chooser-based permission model. | |
| 20 // It uses |NSTableView| to show a list of options for user to grant | |
| 21 // permission. It can be used by the WebUSB or WebBluetooth APIs. | |
| 22 // It is owned by the BubbleController, which is owned by the BubbleManager. | |
| 23 class ChooserBubbleUiCocoa : public BubbleUi { | |
| 24 public: | |
| 25 ChooserBubbleUiCocoa(Browser* browser, | |
| 26 std::unique_ptr<ChooserController> chooser_controller); | |
| 27 ~ChooserBubbleUiCocoa() override; | |
| 28 | |
| 29 // BubbleUi: | |
| 30 void Show(BubbleReference bubble_reference) override; | |
| 31 void Close() override; | |
| 32 void UpdateAnchorPosition() override; | |
| 33 | |
| 34 // Called when |chooser_bubble_ui_controller_| is closing. | |
| 35 void OnBubbleClosing(); | |
| 36 | |
| 37 private: | |
| 38 Browser* browser_; // Weak. | |
| 39 // Cocoa-side chooser bubble UI controller. Weak, as it will close itself. | |
| 40 ChooserBubbleUiController* chooser_bubble_ui_controller_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa); | |
| 43 }; | |
| 44 | |
| 45 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ | |
| OLD | NEW |