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

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h

Issue 1984923002: Refactor ChooserBubbleController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ 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_ 6 #define CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "chrome/browser/ui/website_settings/chooser_bubble_controller.h"
12 #include "components/bubble/bubble_ui.h" 11 #include "components/bubble/bubble_ui.h"
12 #include "components/chooser_controller/chooser_controller.h"
13 13
14 class Browser; 14 class Browser;
15 @class ChooserBubbleUiController; 15 @class ChooserBubbleUiController;
16 16
17 // ChooserBubbleUiCocoa implements a chooser-based permission model. 17 // ChooserBubbleUiCocoa implements a chooser-based permission model.
18 // It uses |NSTableView| to show a list of options for user to grant 18 // It uses |NSTableView| to show a list of options for user to grant
19 // permission. It can be used by the WebUSB or WebBluetooth APIs. 19 // permission. It can be used by the WebUSB or WebBluetooth APIs.
20 // It is owned by the BubbleController, which is owned by the BubbleManager.
20 class ChooserBubbleUiCocoa : public BubbleUi, 21 class ChooserBubbleUiCocoa : public BubbleUi,
21 public ChooserBubbleController::Observer { 22 public ChooserController::Observer {
22 public: 23 public:
23 ChooserBubbleUiCocoa(Browser* browser, 24 ChooserBubbleUiCocoa(Browser* browser, ChooserController* chooser_controller);
24 ChooserBubbleController* chooser_bubble_controller);
25 ~ChooserBubbleUiCocoa() override; 25 ~ChooserBubbleUiCocoa() override;
26 26
27 // BubbleUi: 27 // BubbleUi:
28 void Show(BubbleReference bubble_reference) override; 28 void Show(BubbleReference bubble_reference) override;
29 void Close() override; 29 void Close() override;
30 void UpdateAnchorPosition() override; 30 void UpdateAnchorPosition() override;
31 31
32 // ChooserBubbleController::Observer: 32 // ChooserController::Observer:
33 void OnOptionsInitialized() override; 33 void OnOptionsInitialized() override;
34 void OnOptionAdded(size_t index) override; 34 void OnOptionAdded(size_t index) override;
35 void OnOptionRemoved(size_t index) override; 35 void OnOptionRemoved(size_t index) override;
36 36
37 // Called when |chooser_bubble_ui_controller_| is closing. 37 // Called when |chooser_bubble_ui_controller_| is closing.
38 void OnBubbleClosing(); 38 void OnBubbleClosing();
39 39
40 private: 40 private:
41 Browser* browser_; // Weak. 41 Browser* browser_; // Weak.
42 ChooserBubbleController* chooser_bubble_controller_; // Weak. 42 ChooserController* chooser_controller_; // Weak.
43 // Cocoa-side chooser bubble UI controller. Weak, as it will close itself. 43 // Cocoa-side chooser bubble UI controller. Weak, as it will close itself.
44 ChooserBubbleUiController* chooser_bubble_ui_controller_; 44 ChooserBubbleUiController* chooser_bubble_ui_controller_;
45 45
46 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa); 46 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa);
47 }; 47 };
48 48
49 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ 49 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698