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

Unified Diff: chrome/browser/ui/views/website_settings/permissions_bubble_view.h

Issue 1935993004: MacViews: support Views permission bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/website_settings/permissions_bubble_view.h
diff --git a/chrome/browser/ui/views/website_settings/permissions_bubble_view.h b/chrome/browser/ui/views/website_settings/permissions_bubble_view.h
index ccc94dea2b10823d948fdb4f0145a939c1fa485b..c8bb882f6f14e0ff3b1f1b8638a9763b5ce89ad8 100644
--- a/chrome/browser/ui/views/website_settings/permissions_bubble_view.h
+++ b/chrome/browser/ui/views/website_settings/permissions_bubble_view.h
@@ -5,11 +5,13 @@
#ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
+#include <memory>
#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "chrome/browser/ui/website_settings/permission_bubble_view.h"
+#include "ui/gfx/geometry/point.h"
#include "ui/views/bubble/bubble_border.h"
namespace views {
@@ -21,7 +23,22 @@ class PermissionsBubbleDialogDelegateView;
class PermissionBubbleViewViews : public PermissionBubbleView {
public:
- explicit PermissionBubbleViewViews(Browser* browser);
+ // A PermissionBubbleViewViews owns an AnchorDelegate, which is passed in when
+ // constructing the PermissionBubbleViewViews. The AnchorDelegate is
+ // responsible for determining the anchor view (or point, for platforms
+ // without an appropriate native view) and the immediate parent NativeView of
+ // this view.
+ class AnchorDelegate {
+ public:
+ AnchorDelegate(){}
tapted 2016/05/03 12:02:39 nit: space before {}
Elly Fong-Jones 2016/05/10 21:21:02 Done.
+ virtual ~AnchorDelegate(){}
tapted 2016/05/03 12:02:39 I think we can omit the destructor altogether for
Elly Fong-Jones 2016/05/10 21:21:02 Then the destructor isn't virtual and can't be ove
tapted 2016/05/11 07:06:18 I don't think we need to override it in the childr
+ virtual views::View* GetAnchorView() = 0;
+ virtual gfx::Point GetAnchorPoint() = 0;
+ virtual gfx::NativeView GetParentView() = 0;
+ };
+
+ PermissionBubbleViewViews(Browser* browser,
+ std::unique_ptr<AnchorDelegate> anchor_delegate);
tapted 2016/05/03 12:02:39 Since both AnchorDelegates are just created from t
Elly Fong-Jones 2016/05/10 21:21:02 Done.
~PermissionBubbleViewViews() override;
// PermissionBubbleView:
@@ -41,11 +58,13 @@ class PermissionBubbleViewViews : public PermissionBubbleView {
private:
views::View* GetAnchorView();
+ gfx::Point GetAnchorPoint();
tapted 2016/05/03 12:02:39 this might not be needed. In fact we can probably
Elly Fong-Jones 2016/05/10 21:21:02 Done.
views::BubbleBorder::Arrow GetAnchorArrow();
Browser* browser_;
Delegate* delegate_;
PermissionsBubbleDialogDelegateView* bubble_delegate_;
+ std::unique_ptr<AnchorDelegate> anchor_delegate_;
DISALLOW_COPY_AND_ASSIGN(PermissionBubbleViewViews);
};

Powered by Google App Engine
This is Rietveld 408576698