OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_H_ |
| 7 |
| 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 9 #include "googleurl/src/gurl.h" |
| 10 |
| 11 #include <string> |
| 12 |
| 13 class GeolocationInfoBarQueueController; |
| 14 class InfoBarTabHelper; |
| 15 |
| 16 // GeolocationInfoBarDelegates are created by the |
| 17 // GeolocationInfoBarQueueController to control the display |
| 18 // and handling of geolocation permission infobars to the user. |
| 19 class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 20 public: |
| 21 GeolocationConfirmInfoBarDelegate( |
| 22 InfoBarTabHelper* infobar_helper, |
| 23 GeolocationInfoBarQueueController* controller, |
| 24 int render_process_id, |
| 25 int render_view_id, |
| 26 int bridge_id, |
| 27 const GURL& requesting_frame_url, |
| 28 const std::string& display_languages); |
| 29 |
| 30 int render_process_id() const { return render_process_id_; } |
| 31 int render_view_id() const { return render_view_id_; } |
| 32 |
| 33 protected: |
| 34 // ConfirmInfoBarDelegate: |
| 35 virtual gfx::Image* GetIcon() const OVERRIDE; |
| 36 virtual Type GetInfoBarType() const OVERRIDE; |
| 37 virtual string16 GetMessageText() const OVERRIDE; |
| 38 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; |
| 39 virtual bool Accept() OVERRIDE; |
| 40 virtual bool Cancel() OVERRIDE; |
| 41 virtual string16 GetLinkText() const OVERRIDE; |
| 42 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; |
| 43 |
| 44 // Call back to the controller, to inform of the user's decision. |
| 45 void SetPermission(bool update_content_setting, bool allowed); |
| 46 |
| 47 private: |
| 48 GeolocationInfoBarQueueController* controller_; |
| 49 int render_process_id_; |
| 50 int render_view_id_; |
| 51 int bridge_id_; |
| 52 |
| 53 GURL requesting_frame_url_; |
| 54 std::string display_languages_; |
| 55 |
| 56 DISALLOW_IMPLICIT_CONSTRUCTORS(GeolocationConfirmInfoBarDelegate); |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_H_ |
OLD | NEW |