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

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

Issue 1528543004: Update chooser bubble ui cocoa code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@modify_base_bubble_controller_dealloc
Patch Set: updated chooser bubble ui cocoa code based on rsesek@'s comments Created 5 years 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_delegate.h" 11 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h"
12 #include "components/bubble/bubble_ui.h" 12 #include "components/bubble/bubble_ui.h"
13 13
14 class Browser; 14 class Browser;
15 class ChooserBubbleDelegate; 15 class ChooserBubbleDelegate;
16 @class ChooserBubbleUiController; 16 @class ChooserBubbleUiController;
17 17
18 // ChooserBubbleUiCocoa implements a chooser-based permission model. 18 // ChooserBubbleUiCocoa implements a chooser-based permission model.
19 // It uses |NSTableView| to show a list of options for user to grant 19 // It uses |NSTableView| to show a list of options for user to grant
20 // permission. It can be used by the WebUSB or WebBluetooth APIs. 20 // permission. It can be used by the WebUSB or WebBluetooth APIs.
21 class ChooserBubbleUiCocoa : public BubbleUi, 21 class ChooserBubbleUiCocoa : public BubbleUi,
22 public ChooserBubbleDelegate::Observer { 22 public ChooserBubbleDelegate::Observer {
23 public: 23 public:
24 ChooserBubbleUiCocoa(Browser* browser, 24 ChooserBubbleUiCocoa(Browser* browser,
25 ChooserBubbleDelegate* chooser_bubble_delegate); 25 ChooserBubbleDelegate* chooserBubbleDelegate);
26 ~ChooserBubbleUiCocoa() override; 26 ~ChooserBubbleUiCocoa() override;
27 27
28 // BubbleUi: 28 // BubbleUi:
29 void Show(BubbleReference bubble_reference) override; 29 void Show(BubbleReference bubble_reference) override;
30 void Close() override; 30 void Close() override;
31 void UpdateAnchorPosition() override; 31 void UpdateAnchorPosition() override;
32 32
33 // ChooserBubbleDelegate::Observer: 33 // ChooserBubbleDelegate::Observer:
34 void OnOptionsInitialized() override; 34 void OnOptionsInitialized() override;
35 void OnOptionAdded(int index) override; 35 void OnOptionAdded(int index) override;
36 void OnOptionRemoved(int index) override; 36 void OnOptionRemoved(int index) override;
37 37
38 // Called when |chooser_bubble_ui_controller_| is closing. 38 // Called when |chooser_bubble_ui_controller_| is closing.
39 void OnBubbleClosing(); 39 void OnBubbleClosing();
40 40
41 private: 41 private:
42 Browser* browser_; // Weak. 42 Browser* browser_; // Weak.
43 ChooserBubbleDelegate* chooser_bubble_delegate_; // Weak. 43 ChooserBubbleDelegate* chooserBubbleDelegate_; // Weak.
Robert Sesek 2015/12/15 15:17:38 The naming here is correct. In ObjC methods and @i
juncai 2015/12/15 18:01:11 Done.
44 // Cocoa-side chooser bubble UI controller. Weak, as it will close itself. 44 // Cocoa-side chooser bubble UI controller. Weak, as it will close itself.
45 ChooserBubbleUiController* chooser_bubble_ui_controller_; 45 ChooserBubbleUiController* chooserBubbleUiController_;
46 46
47 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa); 47 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiCocoa);
48 }; 48 };
49 49
50 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_ 50 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_COCOA_H_
OLDNEW
« no previous file with comments | « no previous file | 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