Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SERVICES_GCM_PERMISSION_INFOBAR_DELEGATE_H_ | |
| 6 #define CHROME_BROWSER_SERVICES_GCM_PERMISSION_INFOBAR_DELEGATE_H_ | |
| 7 | |
| 8 #include "chrome/browser/content_settings/permission_request_id.h" | |
| 9 #include "chrome/browser/infobars/infobar_service.h" | |
| 10 #include "components/infobars/core/confirm_infobar_delegate.h" | |
| 11 #include "content/public/browser/web_contents.h" | |
| 12 | |
| 13 class GURL; | |
| 14 class NavigationDetails; | |
| 15 class PermissionQueueController; | |
| 16 | |
| 17 namespace gcm { | |
| 18 | |
| 19 // Base class for permission infobars, it implements the default behaviour | |
| 20 // so that the accept/deny buttons grant/deny the relevant permission. | |
| 21 // A basic implementor only needs to implement the methods that | |
| 22 // provide an incon and a message text to the infobar. | |
| 23 class PermissionInfobarDelegate : public ConfirmInfoBarDelegate { | |
|
Peter Kasting
2014/06/19 17:58:21
Do you have this base class because your next patc
Miguel Garcia
2014/06/19 21:49:22
Yes, Midi Geolocation and other permission classes
| |
| 24 public: | |
| 25 virtual ~PermissionInfobarDelegate(); | |
| 26 | |
| 27 protected: | |
| 28 PermissionInfobarDelegate(PermissionQueueController* controller, | |
| 29 const PermissionRequestID& id, | |
| 30 GURL& requesting_frame); | |
| 31 | |
| 32 // ConfirmInfoBarDelegate: | |
| 33 virtual void InfoBarDismissed() OVERRIDE; | |
| 34 virtual infobars::InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; | |
| 35 virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; | |
| 36 virtual bool Accept() OVERRIDE; | |
| 37 virtual bool Cancel() OVERRIDE; | |
| 38 | |
| 39 private: | |
| 40 void SetPermission(bool update_content_setting, bool allowed); | |
| 41 | |
| 42 PermissionQueueController* controller_; | |
| 43 const PermissionRequestID id_; | |
| 44 GURL requesting_frame_; | |
| 45 DISALLOW_COPY_AND_ASSIGN(PermissionInfobarDelegate); | |
|
Peter Kasting
2014/06/19 17:58:21
Nit: Blank line above this so it doesn't blend in
Miguel Garcia
2014/06/19 21:49:22
Done.
| |
| 46 }; | |
| 47 | |
| 48 } // namespace gcm | |
|
Peter Kasting
2014/06/19 17:58:20
Nit: Blank line below this
Miguel Garcia
2014/06/19 21:49:22
Done.
| |
| 49 #endif // CHROME_BROWSER_SERVICES_GCM_PERMISSION_INFOBAR_DELEGATE_H_ | |
| OLD | NEW |