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

Side by Side Diff: chrome/browser/ui/views/website_settings/permissions_bubble_view.h

Issue 1970113002: [diff] avoiding regressions for views permissions prompts in fullscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20161112-MacViews-PermisisonBubble
Patch Set: Keep hasVisibleLocationBar for browser_tests Created 4 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 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 <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 15 matching lines...) Expand all
26 // A PermissionBubbleViewViews owns an AnchorDelegate, which is constructed by 26 // A PermissionBubbleViewViews owns an AnchorDelegate, which is constructed by
27 // calling PermissionBubbleViewViews::CreateAnchorDelegate. The AnchorDelegate 27 // calling PermissionBubbleViewViews::CreateAnchorDelegate. The AnchorDelegate
28 // is responsible for determining the anchor view (or point, for platforms 28 // is responsible for determining the anchor view (or point, for platforms
29 // without an appropriate native view) and the immediate parent NativeView of 29 // without an appropriate native view) and the immediate parent NativeView of
30 // this view. 30 // this view.
31 class AnchorDelegate { 31 class AnchorDelegate {
32 public: 32 public:
33 AnchorDelegate() {} 33 AnchorDelegate() {}
34 virtual views::View* GetAnchorView() = 0; 34 virtual views::View* GetAnchorView() = 0;
35 virtual gfx::Point GetAnchorPoint() = 0; 35 virtual gfx::Point GetAnchorPoint() = 0;
36 virtual views::BubbleBorder::Arrow GetAnchorArrow() = 0;
36 }; 37 };
37 38
38 explicit PermissionBubbleViewViews(Browser* browser); 39 explicit PermissionBubbleViewViews(Browser* browser);
39 ~PermissionBubbleViewViews() override; 40 ~PermissionBubbleViewViews() override;
40 41
41 // PermissionBubbleView: 42 // PermissionBubbleView:
42 void SetDelegate(Delegate* delegate) override; 43 void SetDelegate(Delegate* delegate) override;
43 void Show(const std::vector<PermissionBubbleRequest*>& requests, 44 void Show(const std::vector<PermissionBubbleRequest*>& requests,
44 const std::vector<bool>& accept_state) override; 45 const std::vector<bool>& accept_state) override;
45 bool CanAcceptRequestUpdate() override; 46 bool CanAcceptRequestUpdate() override;
46 void Hide() override; 47 void Hide() override;
47 bool IsVisible() override; 48 bool IsVisible() override;
48 void UpdateAnchorPosition() override; 49 void UpdateAnchorPosition() override;
49 gfx::NativeWindow GetNativeWindow() override; 50 gfx::NativeWindow GetNativeWindow() override;
50 51
51 void Closing(); 52 void Closing();
52 void Toggle(int index, bool value); 53 void Toggle(int index, bool value);
53 void Accept(); 54 void Accept();
54 void Deny(); 55 void Deny();
55 56
56 private: 57 private:
57 views::BubbleBorder::Arrow GetAnchorArrow();
58
59 // This function has separate implementations for Views-based and Cocoa-based 58 // This function has separate implementations for Views-based and Cocoa-based
60 // browsers. 59 // browsers.
61 static std::unique_ptr<AnchorDelegate> CreateAnchorDelegate(Browser* browser); 60 static std::unique_ptr<AnchorDelegate> CreateAnchorDelegate(Browser* browser);
62 61
63 Browser* browser_; 62 Browser* browser_;
64 Delegate* delegate_; 63 Delegate* delegate_;
65 PermissionsBubbleDialogDelegateView* bubble_delegate_; 64 PermissionsBubbleDialogDelegateView* bubble_delegate_;
66 std::unique_ptr<AnchorDelegate> anchor_delegate_; 65 std::unique_ptr<AnchorDelegate> anchor_delegate_;
67 66
68 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews); 67 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews);
69 }; 68 };
70 69
71 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ 70 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698