| 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..0447e71eabb0efa975fd46beca31039d437117fd
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h
|
| @@ -0,0 +1,52 @@
|
| +// 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_options.h"
|
| +#include "components/bubble/bubble_ui.h"
|
| +
|
| +class Browser;
|
| +class ChooserBubbleDelegate;
|
| +@class ChooserBubbleUiController;
|
| +class ChooserOptions;
|
| +
|
| +// 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.
|
| +class ChooserBubbleUiCocoa : public BubbleUi, public ChooserOptions::Observer {
|
| + public:
|
| + ChooserBubbleUiCocoa(Browser* browser,
|
| + ChooserOptions* chooser_options,
|
| + ChooserBubbleDelegate* chooser_bubble_delegate);
|
| + ~ChooserBubbleUiCocoa() override;
|
| +
|
| + // BubbleUi:
|
| + void Show(BubbleReference bubble_reference) override;
|
| + void Close() override;
|
| + void UpdateAnchorPosition() override;
|
| +
|
| + // ChooserOptions::Observer:
|
| + void OnOptionsInitialized() override;
|
| + void OnOptionAdded(int index) override;
|
| + void OnOptionRemoved(int index) override;
|
| +
|
| + // Called when |chooser_bubble_ui_controller_| is closing.
|
| + void OnBubbleClosing();
|
| +
|
| + private:
|
| + Browser* browser_; // Weak.
|
| + ChooserOptions* chooser_options_; // 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_
|
|
|