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

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

Issue 1973893002: [diff] Fixing permssions bubbles while in fullscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 <string> 9 #include <string>
9 10
10 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" 13 #include "chrome/browser/ui/website_settings/permission_bubble_view.h"
14 #include "ui/gfx/geometry/point.h"
13 #include "ui/views/bubble/bubble_border.h" 15 #include "ui/views/bubble/bubble_border.h"
14 16
15 namespace views { 17 namespace views {
16 class View; 18 class View;
17 } 19 }
18 20
19 class Browser; 21 class Browser;
20 class PermissionsBubbleDialogDelegateView; 22 class PermissionsBubbleDialogDelegateView;
21 23
22 class PermissionBubbleViewViews : public PermissionBubbleView { 24 class PermissionBubbleViewViews : public PermissionBubbleView {
23 public: 25 public:
26 // A PermissionBubbleViewViews owns an AnchorDelegate, which is constructed by
27 // calling PermissionBubbleViewViews::CreateAnchorDelegate. The AnchorDelegate
28 // is responsible for determining the anchor view (or point, for platforms
29 // without an appropriate native view) and the immediate parent NativeView of
30 // this view.
31 class AnchorDelegate {
32 public:
33 AnchorDelegate() {}
34 virtual views::View* GetAnchorView() = 0;
35 virtual gfx::Point GetAnchorPoint() = 0;
36 };
37
24 explicit PermissionBubbleViewViews(Browser* browser); 38 explicit PermissionBubbleViewViews(Browser* browser);
25 ~PermissionBubbleViewViews() override; 39 ~PermissionBubbleViewViews() override;
26 40
27 // PermissionBubbleView: 41 // PermissionBubbleView:
28 void SetDelegate(Delegate* delegate) override; 42 void SetDelegate(Delegate* delegate) override;
29 void Show(const std::vector<PermissionBubbleRequest*>& requests, 43 void Show(const std::vector<PermissionBubbleRequest*>& requests,
30 const std::vector<bool>& accept_state) override; 44 const std::vector<bool>& accept_state) override;
31 bool CanAcceptRequestUpdate() override; 45 bool CanAcceptRequestUpdate() override;
32 void Hide() override; 46 void Hide() override;
33 bool IsVisible() override; 47 bool IsVisible() override;
34 void UpdateAnchorPosition() override; 48 void UpdateAnchorPosition() override;
35 gfx::NativeWindow GetNativeWindow() override; 49 gfx::NativeWindow GetNativeWindow() override;
36 50
37 void Closing(); 51 void Closing();
38 void Toggle(int index, bool value); 52 void Toggle(int index, bool value);
39 void Accept(); 53 void Accept();
40 void Deny(); 54 void Deny();
41 55
42 private: 56 private:
43 views::View* GetAnchorView();
44 views::BubbleBorder::Arrow GetAnchorArrow(); 57 views::BubbleBorder::Arrow GetAnchorArrow();
45 58
59 // This function has separate implementations for Views-based and Cocoa-based
60 // browsers.
61 static std::unique_ptr<AnchorDelegate> CreateAnchorDelegate(Browser* browser);
62
46 Browser* browser_; 63 Browser* browser_;
47 Delegate* delegate_; 64 Delegate* delegate_;
48 PermissionsBubbleDialogDelegateView* bubble_delegate_; 65 PermissionsBubbleDialogDelegateView* bubble_delegate_;
66 std::unique_ptr<AnchorDelegate> anchor_delegate_;
49 67
50 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews); 68 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews);
51 }; 69 };
52 70
53 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_ 71 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698