OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PERMISSIONS_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" | 12 #include "chrome/browser/ui/website_settings/permission_bubble_view.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 |
| 19 class Browser; |
18 class PermissionsBubbleDelegateView; | 20 class PermissionsBubbleDelegateView; |
19 | 21 |
20 class PermissionBubbleViewViews : public PermissionBubbleView { | 22 class PermissionBubbleViewViews : public PermissionBubbleView { |
21 public: | 23 public: |
22 PermissionBubbleViewViews(views::View* anchor_view, | 24 explicit PermissionBubbleViewViews(Browser* browser); |
23 const std::string& languages); | |
24 ~PermissionBubbleViewViews() override; | 25 ~PermissionBubbleViewViews() override; |
25 | 26 |
| 27 // Updates anchor on fullscreen changes, etc. |
| 28 void UpdateAnchorPosition(); |
| 29 |
26 // PermissionBubbleView: | 30 // PermissionBubbleView: |
27 void SetDelegate(Delegate* delegate) override; | 31 void SetDelegate(Delegate* delegate) override; |
28 void Show(const std::vector<PermissionBubbleRequest*>& requests, | 32 void Show(const std::vector<PermissionBubbleRequest*>& requests, |
29 const std::vector<bool>& accept_state) override; | 33 const std::vector<bool>& accept_state) override; |
30 bool CanAcceptRequestUpdate() override; | 34 bool CanAcceptRequestUpdate() override; |
31 void Hide() override; | 35 void Hide() override; |
32 bool IsVisible() override; | 36 bool IsVisible() override; |
33 | 37 |
34 void Closing(); | 38 void Closing(); |
35 void Toggle(int index, bool value); | 39 void Toggle(int index, bool value); |
36 void Accept(); | 40 void Accept(); |
37 void Deny(); | 41 void Deny(); |
38 | 42 |
39 private: | 43 private: |
40 views::View* anchor_view_; | 44 views::View* GetAnchorView(); |
| 45 views::BubbleBorder::Arrow GetAnchorArrow(); |
| 46 |
| 47 Browser* browser_; |
41 Delegate* delegate_; | 48 Delegate* delegate_; |
42 PermissionsBubbleDelegateView* bubble_delegate_; | 49 PermissionsBubbleDelegateView* bubble_delegate_; |
43 const std::string languages_; | |
44 | 50 |
45 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews); | 51 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews); |
46 }; | 52 }; |
47 | 53 |
48 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ | 54 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ |
OLD | NEW |