OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" | 5 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" |
6 | 6 |
7 #include "chrome/browser/android/android_theme_resources.h" | 7 #include "chrome/browser/android/android_theme_resources.h" |
8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
12 | 12 |
13 // static | 13 // static |
14 infobars::InfoBar* GeolocationInfoBarDelegateAndroid::Create( | 14 infobars::InfoBar* GeolocationInfoBarDelegateAndroid::Create( |
15 InfoBarService* infobar_service, | 15 InfoBarService* infobar_service, |
16 const GURL& requesting_frame, | 16 const GURL& requesting_frame, |
| 17 Profile* profile, |
17 const PermissionSetCallback& callback) { | 18 const PermissionSetCallback& callback) { |
18 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( | 19 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
19 std::unique_ptr<ConfirmInfoBarDelegate>( | 20 std::unique_ptr<ConfirmInfoBarDelegate>( |
20 new GeolocationInfoBarDelegateAndroid(requesting_frame, callback)))); | 21 new GeolocationInfoBarDelegateAndroid(requesting_frame, profile, |
| 22 callback)))); |
21 } | 23 } |
22 | 24 |
23 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( | 25 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( |
24 const GURL& requesting_frame, | 26 const GURL& requesting_frame, |
| 27 Profile* profile, |
25 const PermissionSetCallback& callback) | 28 const PermissionSetCallback& callback) |
26 : PermissionInfobarDelegate(requesting_frame, | 29 : PermissionInfobarDelegate(requesting_frame, |
27 content::PermissionType::GEOLOCATION, | 30 content::PermissionType::GEOLOCATION, |
28 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 31 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 32 profile, |
29 callback), | 33 callback), |
30 requesting_frame_(requesting_frame) {} | 34 requesting_frame_(requesting_frame) {} |
31 | 35 |
32 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() {} | 36 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() {} |
33 | 37 |
34 infobars::InfoBarDelegate::InfoBarIdentifier | 38 infobars::InfoBarDelegate::InfoBarIdentifier |
35 GeolocationInfoBarDelegateAndroid::GetIdentifier() const { | 39 GeolocationInfoBarDelegateAndroid::GetIdentifier() const { |
36 return GEOLOCATION_INFOBAR_DELEGATE_ANDROID; | 40 return GEOLOCATION_INFOBAR_DELEGATE_ANDROID; |
37 } | 41 } |
38 | 42 |
39 int GeolocationInfoBarDelegateAndroid::GetIconId() const { | 43 int GeolocationInfoBarDelegateAndroid::GetIconId() const { |
40 return IDR_ANDROID_INFOBAR_GEOLOCATION; | 44 return IDR_ANDROID_INFOBAR_GEOLOCATION; |
41 } | 45 } |
42 | 46 |
43 int GeolocationInfoBarDelegateAndroid::GetMessageResourceId() const { | 47 int GeolocationInfoBarDelegateAndroid::GetMessageResourceId() const { |
44 return IDS_GEOLOCATION_INFOBAR_QUESTION; | 48 return IDS_GEOLOCATION_INFOBAR_QUESTION; |
45 } | 49 } |
OLD | NEW |