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

Unified Diff: chrome/browser/services/gcm/push_messaging_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 jianli,jam,fgorski,pkasting 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/push_messaging_infobar_delegate.h
diff --git a/chrome/browser/services/gcm/push_messaging_infobar_delegate.h b/chrome/browser/services/gcm/push_messaging_infobar_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..90384f8b667c9e93381100354781657a2f279c10
--- /dev/null
+++ b/chrome/browser/services/gcm/push_messaging_infobar_delegate.h
@@ -0,0 +1,45 @@
+// 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_PUSH_MESSAGING_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_INFOBAR_DELEGATE_H_
+
+#include "chrome/browser/services/gcm/permission_infobar_delegate.h"
+
+class GURL;
+class InfoBarService;
+
+namespace gcm {
+
+// Delegate to allow GCM push messages registration.
+class PushMessagingInfoBarDelegate : public PermissionInfobarDelegate {
+ public:
+ virtual ~PushMessagingInfoBarDelegate();
+
+ // Creates a Push Permission infobar and delegate and adds the infobar to
+ // |infobar_service|. Returns the infobar if it was successfully added.
+ static infobars::InfoBar* Create(InfoBarService* infobar_service,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
+ const GURL& requesting_frame,
+ const std::string& display_languages);
+
+ private:
+ PushMessagingInfoBarDelegate(PermissionQueueController* controller,
+ const PermissionRequestID& id,
Michael van Ouwerkerk 2014/06/23 12:34:10 Nit: align indentation with first argument.
Miguel Garcia 2014/06/23 18:23:14 Done.
+ const GURL& requesting_frame,
+ const std::string& display_languages);
+
+ // ConfirmInfoBarDelegate:
+ virtual base::string16 GetMessageText() const OVERRIDE;
+
+ const GURL requesting_origin_;
+ const std::string display_languages_;
+
+ DISALLOW_COPY_AND_ASSIGN(PushMessagingInfoBarDelegate);
+};
+
+} // namespace gcm
+#endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_INFOBAR_DELEGATE_H_
+

Powered by Google App Engine
This is Rietveld 408576698