Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Unified Diff: chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h

Issue 2086663003: Change ChooserController ownership model (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build errors Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
index d5c9093c89369f37ad3d84de0ace426c9dea28c8..07b18263b16b67d2cad4c8d61e828f7418be1ea2 100644
--- a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h
+++ b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h
@@ -7,21 +7,23 @@
#import <Cocoa/Cocoa.h>
+#include <memory>
+
#include "base/macros.h"
#include "components/bubble/bubble_ui.h"
-#include "components/chooser_controller/chooser_controller.h"
class Browser;
@class ChooserBubbleUiController;
+class ChooserController;
// ChooserBubbleUiCocoa implements a chooser-based permission model.
// It uses |NSTableView| to show a list of options for user to grant
// permission. It can be used by the WebUSB or WebBluetooth APIs.
// It is owned by the BubbleController, which is owned by the BubbleManager.
-class ChooserBubbleUiCocoa : public BubbleUi,
- public ChooserController::Observer {
+class ChooserBubbleUiCocoa : public BubbleUi {
public:
- ChooserBubbleUiCocoa(Browser* browser, ChooserController* chooser_controller);
+ ChooserBubbleUiCocoa(Browser* browser,
+ std::unique_ptr<ChooserController> chooser_controller);
~ChooserBubbleUiCocoa() override;
// BubbleUi:
@@ -29,17 +31,14 @@ class ChooserBubbleUiCocoa : public BubbleUi,
void Close() override;
void UpdateAnchorPosition() override;
- // ChooserController::Observer:
- void OnOptionsInitialized() override;
- void OnOptionAdded(size_t index) override;
- void OnOptionRemoved(size_t index) override;
-
// Called when |chooser_bubble_ui_controller_| is closing.
void OnBubbleClosing();
private:
- Browser* browser_; // Weak.
- ChooserController* chooser_controller_; // Weak.
+ Browser* browser_; // Weak.
+ // |chooser_controller_| is not owned by this class.
+ // It is owned by ChooserContentViewCocoa.
+ std::unique_ptr<ChooserController> chooser_controller_;
Reilly Grant (use Gerrit) 2016/06/22 00:01:32 The comment is confusing because it seems to be di
juncai 2016/06/22 01:17:45 Done.
// Cocoa-side chooser bubble UI controller. Weak, as it will close itself.
ChooserBubbleUiController* chooser_bubble_ui_controller_;

Powered by Google App Engine
This is Rietveld 408576698