| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/bubble/bubble_ui.h" | 9 #include "components/bubble/bubble_ui.h" |
| 10 #include "ui/views/bubble/bubble_border.h" | 10 #include "ui/views/bubble/bubble_border.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 class View; | 13 class View; |
| 14 } | 14 } |
| 15 | 15 |
| 16 class Browser; | 16 class Browser; |
| 17 class ChooserController; | 17 class ChooserController; |
| 18 class ChooserBubbleUiViewDelegate; | 18 class ChooserBubbleUiViewDelegate; |
| 19 | 19 |
| 20 // ChooserBubbleUiView implements a chooser-based permission model, | 20 // ChooserBubbleUiView implements a chooser-based permission model, |
| 21 // it uses table view to show a list of items (such as usb devices, etc.) | 21 // it uses table view to show a list of items (such as usb devices, etc.) |
| 22 // for user to grant permission. It can be used by the WebUSB or WebBluetooth | 22 // for user to grant permission. It can be used by the WebUSB or WebBluetooth |
| 23 // APIs. It is owned by the BubbleController, which is owned by the | 23 // APIs. It is owned by the BubbleController, which is owned by the |
| 24 // BubbleManager. | 24 // BubbleManager. |
| 25 class ChooserBubbleUiView : public BubbleUi { | 25 class ChooserBubbleUiView : public BubbleUi { |
| 26 public: | 26 public: |
| 27 ChooserBubbleUiView(Browser* browser, ChooserController* controller); | 27 ChooserBubbleUiView(Browser* browser, ChooserController* chooser_controller); |
| 28 ~ChooserBubbleUiView() override; | 28 ~ChooserBubbleUiView() override; |
| 29 | 29 |
| 30 // BubbleUi: | 30 // BubbleUi: |
| 31 void Show(BubbleReference bubble_reference) override; | 31 void Show(BubbleReference bubble_reference) override; |
| 32 void Close() override; | 32 void Close() override; |
| 33 void UpdateAnchorPosition() override; | 33 void UpdateAnchorPosition() override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 friend class ChooserBubbleUiViewDelegate; | 36 friend class ChooserBubbleUiViewDelegate; |
| 37 views::View* GetAnchorView(); | 37 views::View* GetAnchorView(); |
| 38 views::BubbleBorder::Arrow GetAnchorArrow(); | 38 views::BubbleBorder::Arrow GetAnchorArrow(); |
| 39 | 39 |
| 40 Browser* browser_; // Weak. | 40 Browser* browser_; // Weak. |
| 41 ChooserController* controller_; // Weak. | 41 // Weak, owned by ChooserBubbleDelegate. |
| 42 ChooserController* chooser_controller_; |
| 43 // Weak. Owned by its parent view. |
| 42 ChooserBubbleUiViewDelegate* chooser_bubble_ui_view_delegate_; | 44 ChooserBubbleUiViewDelegate* chooser_bubble_ui_view_delegate_; |
| 43 | 45 |
| 44 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiView); | 46 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiView); |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ | 49 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOOSER_BUBBLE_UI_VIEW_H_ |
| OLD | NEW |