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

Side by Side Diff: chrome/browser/ui/views/permission_bubble/chooser_bubble_ui_view.h

Issue 2853143003: MacViews: Allows the toolkit-views Device Chooser bubble to be used (Closed)
Patch Set: MacViews: Allows the toolkit-views Device Chooser bubble to be used Created 3 years, 7 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_VIEWS_PERMISSION_BUBBLE_CHOOSER_BUBBLE_UI_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PERMISSION_BUBBLE_CHOOSER_BUBBLE_UI_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PERMISSION_BUBBLE_CHOOSER_BUBBLE_UI_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PERMISSION_BUBBLE_CHOOSER_BUBBLE_UI_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/bubble/bubble_ui.h" 11 #include "components/bubble/bubble_ui.h"
12 #include "ui/gfx/geometry/point.h"
tapted 2017/05/03 01:10:53 nit: forward declare
varkha 2017/05/03 05:01:21 Acknowledged.
12 #include "ui/views/bubble/bubble_border.h" 13 #include "ui/views/bubble/bubble_border.h"
13 14
14 namespace views { 15 namespace views {
15 class View; 16 class View;
16 } 17 }
17 18
18 class Browser; 19 class Browser;
19 class ChooserController; 20 class ChooserController;
20 class ChooserBubbleUiViewDelegate; 21 class ChooserBubbleUiViewDelegate;
21 22
22 // ChooserBubbleUiView implements a chooser-based permission model, 23 // ChooserBubbleUiView implements a chooser-based permission model,
23 // it uses table view to show a list of items (such as usb devices, etc.) 24 // it uses table view to show a list of items (such as usb devices, etc.)
24 // for user to grant permission. It can be used by the WebUSB or WebBluetooth 25 // for user to grant permission. It can be used by the WebUSB or WebBluetooth
25 // APIs. It is owned by the BubbleController, which is owned by the 26 // APIs. It is owned by the BubbleController, which is owned by the
26 // BubbleManager. 27 // BubbleManager.
27 class ChooserBubbleUiView : public BubbleUi { 28 class ChooserBubbleUiView : public BubbleUi {
28 public: 29 public:
29 ChooserBubbleUiView(Browser* browser, 30 ChooserBubbleUiView(Browser* browser,
30 std::unique_ptr<ChooserController> chooser_controller); 31 std::unique_ptr<ChooserController> chooser_controller,
32 const gfx::Point& anchor_point);
31 ~ChooserBubbleUiView() override; 33 ~ChooserBubbleUiView() override;
32 34
33 // BubbleUi: 35 // BubbleUi:
34 void Show(BubbleReference bubble_reference) override; 36 void Show(BubbleReference bubble_reference) override;
35 void Close() override; 37 void Close() override;
36 void UpdateAnchorPosition() override; 38 void UpdateAnchorPosition() override;
37 39
38 private: 40 private:
39 views::View* GetAnchorView(); 41 views::View* GetAnchorView();
40 views::BubbleBorder::Arrow GetAnchorArrow(); 42 views::BubbleBorder::Arrow GetAnchorArrow();
41 43
42 Browser* browser_; // Weak. 44 Browser* browser_; // Weak.
43 // Weak. Owned by its parent view. 45 // Weak. Owned by its parent view.
44 ChooserBubbleUiViewDelegate* chooser_bubble_ui_view_delegate_; 46 ChooserBubbleUiViewDelegate* chooser_bubble_ui_view_delegate_;
45 47
46 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiView); 48 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiView);
47 }; 49 };
48 50
49 #endif // CHROME_BROWSER_UI_VIEWS_PERMISSION_BUBBLE_CHOOSER_BUBBLE_UI_VIEW_H_ 51 #endif // CHROME_BROWSER_UI_VIEWS_PERMISSION_BUBBLE_CHOOSER_BUBBLE_UI_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698