OLD | NEW |
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_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ |
7 | 7 |
8 #include "components/bubble/bubble_ui.h" | 8 #include "components/bubble/bubble_ui.h" |
9 #include "ui/views/bubble/bubble_border.h" | 9 #include "ui/views/bubble/bubble_border.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 class View; | 12 class View; |
13 } | 13 } |
14 | 14 |
15 class Browser; | 15 class Browser; |
16 class ChooserBubbleDelegate; | 16 class ChooserBubbleController; |
17 class ChooserBubbleUiViewDelegate; | 17 class ChooserBubbleUiViewDelegate; |
18 | 18 |
19 // ChooserBubbleUiView implements a chooser-based permission model, | 19 // ChooserBubbleUiView implements a chooser-based permission model, |
20 // it uses table view to show a list of items (such as usb devices, etc.) | 20 // it uses table view to show a list of items (such as usb devices, etc.) |
21 // for user to grant permission. It can be used by WebUsb, WebBluetooth. | 21 // for user to grant permission. It can be used by WebUsb, WebBluetooth. |
22 class ChooserBubbleUiView : public BubbleUi { | 22 class ChooserBubbleUiView : public BubbleUi { |
23 public: | 23 public: |
24 ChooserBubbleUiView(Browser* browser, | 24 ChooserBubbleUiView(Browser* browser, ChooserBubbleController* controller); |
25 ChooserBubbleDelegate* chooser_bubble_delegate); | |
26 ~ChooserBubbleUiView() override; | 25 ~ChooserBubbleUiView() override; |
27 | 26 |
28 // BubbleUi: | 27 // BubbleUi: |
29 void Show(BubbleReference bubble_reference) override; | 28 void Show(BubbleReference bubble_reference) override; |
30 void Close() override; | 29 void Close() override; |
31 void UpdateAnchorPosition() override; | 30 void UpdateAnchorPosition() override; |
32 | 31 |
33 private: | 32 private: |
34 friend class ChooserBubbleUiViewDelegate; | 33 friend class ChooserBubbleUiViewDelegate; |
35 views::View* GetAnchorView(); | 34 views::View* GetAnchorView(); |
36 views::BubbleBorder::Arrow GetAnchorArrow(); | 35 views::BubbleBorder::Arrow GetAnchorArrow(); |
37 | 36 |
38 Browser* browser_; | 37 Browser* browser_; |
39 ChooserBubbleDelegate* chooser_bubble_delegate_; | 38 ChooserBubbleController* controller_; |
40 ChooserBubbleUiViewDelegate* chooser_bubble_ui_view_delegate_; | 39 ChooserBubbleUiViewDelegate* chooser_bubble_ui_view_delegate_; |
41 }; | 40 }; |
42 | 41 |
43 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ | 42 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ |
OLD | NEW |