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_options.h" |
| 12 #include "components/bubble/bubble_ui.h" |
| 13 |
| 14 class Browser; |
| 15 class ChooserBubbleDelegate; |
| 16 @class ChooserBubbleUiController; |
| 17 class ChooserOptions; |
| 18 |
| 19 // ChooserBubbleUiCocoa implements a chooser-based permission model, |
| 20 // it uses table view to show a list of options for user to grant |
| 21 // permission. It can be used by WebUsb, WebBluetooth. |
| 22 class ChooserBubbleUiCocoa : public BubbleUi, public ChooserOptions::Observer { |
| 23 public: |
| 24 ChooserBubbleUiCocoa(Browser* browser, |
| 25 ChooserOptions* chooser_options, |
| 26 ChooserBubbleDelegate* chooser_bubble_delegate); |
| 27 ~ChooserBubbleUiCocoa() override; |
| 28 |
| 29 // BubbleUi: |
| 30 void Show(BubbleReference bubble_reference) override; |
| 31 void Close() override; |
| 32 void UpdateAnchorPosition() override; |
| 33 |
| 34 // ChooserOptions::Observer: |
| 35 void OnOptionsInitialized() override; |
| 36 void OnOptionAdded(int index) override; |
| 37 void OnOptionRemoved(int index) override; |
| 38 |
| 39 // Called when |chooser_bubble_ui_controller_| is closing. |
| 40 void OnBubbleClosing(); |
| 41 |
| 42 private: |
| 43 Browser* browser_; // Weak. |
| 44 ChooserOptions* chooser_options_; // Weak. |
| 45 ChooserBubbleDelegate* chooser_bubble_delegate_; // Weak. |
| 46 // Cocoa-side chooser bubble UI controller. Weak, as it will close itself. |
| 47 ChooserBubbleUiController* chooser_bubble_ui_controller_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa); |
| 50 }; |
| 51 |
| 52 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ |
OLD | NEW |