Chromium Code Reviews| Index: chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h |
| diff --git a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d75b153c689083e51a6cd4d791e398654f13b87 |
| --- /dev/null |
| +++ b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ |
| +#define CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ |
| + |
| +#import <Cocoa/Cocoa.h> |
| + |
| +#include "base/macros.h" |
| +#include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h" |
| +#include "components/bubble/bubble_ui.h" |
| + |
| +class Browser; |
| +class ChooserBubbleDelegate; |
| +@class ChooserBubbleUiController; |
| + |
| +// ChooserBubbleUiCocoa implements a chooser-based permission model, |
| +// it uses table view to show a list of options for user to grant |
| +// 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.
|
| +class ChooserBubbleUiCocoa : public BubbleUi, |
| + public ChooserBubbleDelegate::Observer { |
| + public: |
| + ChooserBubbleUiCocoa(Browser* browser, |
| + ChooserBubbleDelegate* chooser_bubble_delegate); |
| + ~ChooserBubbleUiCocoa() override; |
| + |
| + // BubbleUi: |
| + void Show(BubbleReference bubble_reference) override; |
| + void Close() override; |
| + void UpdateAnchorPosition() override; |
| + |
| + // ChooserBubbleDelegate::Observer: |
| + void OnOptionsInitialized() override; |
| + void OnOptionAdded(int index) override; |
| + void OnOptionRemoved(int index) override; |
| + |
| + // 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
|
| + void OnBubbleClosing(); |
| + |
| + private: |
| + Browser* browser_; // Weak. |
| + ChooserBubbleDelegate* chooser_bubble_delegate_; // Weak. |
| + // Cocoa-side chooser bubble UI controller. Weak, as it will close itself. |
| + ChooserBubbleUiController* chooser_bubble_ui_controller_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ |