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 void UpdateAnchorPosition(); | |
msw
2015/03/23 19:34:53
nit: add a simple comment like "Updates the anchor
hcarmona
2015/03/23 20:47:45
Done.
| |
28 | |
26 // PermissionBubbleView: | 29 // PermissionBubbleView: |
27 void SetDelegate(Delegate* delegate) override; | 30 void SetDelegate(Delegate* delegate) override; |
28 void Show(const std::vector<PermissionBubbleRequest*>& requests, | 31 void Show(const std::vector<PermissionBubbleRequest*>& requests, |
29 const std::vector<bool>& accept_state) override; | 32 const std::vector<bool>& accept_state) override; |
30 bool CanAcceptRequestUpdate() override; | 33 bool CanAcceptRequestUpdate() override; |
31 void Hide() override; | 34 void Hide() override; |
32 bool IsVisible() override; | 35 bool IsVisible() override; |
33 | 36 |
34 void Closing(); | 37 void Closing(); |
35 void Toggle(int index, bool value); | 38 void Toggle(int index, bool value); |
36 void Accept(); | 39 void Accept(); |
37 void Deny(); | 40 void Deny(); |
38 | 41 |
39 private: | 42 private: |
40 views::View* anchor_view_; | 43 views::View* GetAnchorView(); |
44 views::BubbleBorder::Arrow GetAnchorArrow(); | |
45 | |
46 Browser* browser_; | |
41 Delegate* delegate_; | 47 Delegate* delegate_; |
42 PermissionsBubbleDelegateView* bubble_delegate_; | 48 PermissionsBubbleDelegateView* bubble_delegate_; |
43 const std::string languages_; | |
44 | 49 |
45 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews); | 50 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews); |
46 }; | 51 }; |
47 | 52 |
48 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ | 53 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ |
OLD | NEW |