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

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: factor out Views delegate 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 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..fb8527a40173848b253b1594bdc9ff36cc940eab 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,14 @@
#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/platform_util.h"
tapted 2016/05/11 07:06:19 nit: is this needed here?
Elly Fong-Jones 2016/05/11 19:16:38 Done.
#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,6 +24,19 @@ class PermissionsBubbleDialogDelegateView;
class PermissionBubbleViewViews : public PermissionBubbleView {
public:
+ // A PermissionBubbleViewViews owns an AnchorDelegate, which is passed in when
tapted 2016/05/11 07:06:19 nit: update comment (e.g. the delegate is no longe
Elly Fong-Jones 2016/05/11 19:16:38 Done.
+ // 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() {}
+ virtual ~AnchorDelegate() {}
tapted 2016/05/11 07:06:19 (removing all 3 AnchorDelegate destructors should
Elly Fong-Jones 2016/05/11 19:16:38 Done.
+ virtual views::View* GetAnchorView() = 0;
+ virtual gfx::Point GetAnchorPoint() = 0;
+ };
+
explicit PermissionBubbleViewViews(Browser* browser);
~PermissionBubbleViewViews() override;
@@ -40,12 +56,14 @@ class PermissionBubbleViewViews : public PermissionBubbleView {
void Deny();
private:
- views::View* GetAnchorView();
views::BubbleBorder::Arrow GetAnchorArrow();
+ static std::unique_ptr<AnchorDelegate> CreateAnchorDelegate(Browser* browser);
tapted 2016/05/11 07:06:19 nit: needs a comment - (be sure to mention that it
Elly Fong-Jones 2016/05/11 19:16:38 Done.
+
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