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