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

Unified Diff: chrome/browser/services/gcm/permission_infobar_delegate.h

Issue 343743004: Implement a permission check for push. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments from Peter, Bernhard and Elliot Created 6 years, 6 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/services/gcm/permission_infobar_delegate.h
diff --git a/chrome/browser/services/gcm/permission_infobar_delegate.h b/chrome/browser/services/gcm/permission_infobar_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..efd875bd87a591864855af304e73765cf4136c1c
--- /dev/null
+++ b/chrome/browser/services/gcm/permission_infobar_delegate.h
@@ -0,0 +1,50 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SERVICES_GCM_PERMISSION_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_SERVICES_GCM_PERMISSION_INFOBAR_DELEGATE_H_
+
+#include "chrome/browser/content_settings/permission_request_id.h"
+#include "chrome/browser/infobars/infobar_service.h"
+#include "components/infobars/core/confirm_infobar_delegate.h"
+#include "content/public/browser/web_contents.h"
+
+class GURL;
jianli 2014/06/20 17:19:30 Is this needed? It seems that you need the definit
Miguel Garcia 2014/06/20 20:50:12 Now that it's not a reference anymore I in fact do
+class NavigationDetails;
+class PermissionQueueController;
+
+namespace gcm {
+
+// Base class for permission infobars, it implements the default behaviour
+// so that the accept/deny buttons grant/deny the relevant permission.
+// A basic implementor only needs to implement the methods that
+// provide an incon and a message text to the infobar.
+class PermissionInfobarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ virtual ~PermissionInfobarDelegate();
+
+ protected:
+ PermissionInfobarDelegate(PermissionQueueController* controller,
+ const PermissionRequestID& id,
+ GURL& requesting_frame);
fgorski 2014/06/20 14:14:15 const &
Miguel Garcia 2014/06/20 20:50:12 Done.
+
+ // ConfirmInfoBarDelegate:
+ virtual void InfoBarDismissed() OVERRIDE;
+ virtual infobars::InfoBarDelegate::Type GetInfoBarType() const OVERRIDE;
+ virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
+ virtual bool Accept() OVERRIDE;
+ virtual bool Cancel() OVERRIDE;
+
+ private:
+ void SetPermission(bool update_content_setting, bool allowed);
+
+ PermissionQueueController* controller_;
jianli 2014/06/20 17:19:29 Document the lifetime or ownership for this pointe
Miguel Garcia 2014/06/20 20:50:12 Done.
+ const PermissionRequestID id_;
+ GURL requesting_frame_;
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionInfobarDelegate);
+};
+
+} // namespace gcm
+#endif // CHROME_BROWSER_SERVICES_GCM_PERMISSION_INFOBAR_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698