| 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 bool user_gesture, | 17 bool user_gesture, |
| 18 Profile* profile, | 18 Profile* profile, |
| 19 const PermissionSetCallback& callback) { | 19 const PermissionSetCallback& callback) { |
| 20 return infobar_service->AddInfoBar( | 20 return infobar_service->AddInfoBar( |
| 21 CreatePermissionInfoBar(std::unique_ptr<PermissionInfobarDelegate>( | 21 CreatePermissionInfoBar(std::unique_ptr<PermissionInfoBarDelegate>( |
| 22 new GeolocationInfoBarDelegateAndroid(requesting_frame, user_gesture, | 22 new GeolocationInfoBarDelegateAndroid(requesting_frame, user_gesture, |
| 23 profile, callback)))); | 23 profile, callback)))); |
| 24 } | 24 } |
| 25 | 25 |
| 26 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( | 26 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( |
| 27 const GURL& requesting_frame, | 27 const GURL& requesting_frame, |
| 28 bool user_gesture, | 28 bool user_gesture, |
| 29 Profile* profile, | 29 Profile* profile, |
| 30 const PermissionSetCallback& callback) | 30 const PermissionSetCallback& callback) |
| 31 : PermissionInfobarDelegate(requesting_frame, | 31 : SinglePermissionInfoBarDelegate(requesting_frame, |
| 32 content::PermissionType::GEOLOCATION, | 32 content::PermissionType::GEOLOCATION, |
| 33 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 33 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 34 user_gesture, | 34 user_gesture, |
| 35 profile, | 35 profile, |
| 36 callback), | 36 callback) {} |
| 37 requesting_frame_(requesting_frame) {} | |
| 38 | 37 |
| 39 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() {} | 38 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() {} |
| 40 | 39 |
| 41 infobars::InfoBarDelegate::InfoBarIdentifier | 40 infobars::InfoBarDelegate::InfoBarIdentifier |
| 42 GeolocationInfoBarDelegateAndroid::GetIdentifier() const { | 41 GeolocationInfoBarDelegateAndroid::GetIdentifier() const { |
| 43 return GEOLOCATION_INFOBAR_DELEGATE_ANDROID; | 42 return GEOLOCATION_INFOBAR_DELEGATE_ANDROID; |
| 44 } | 43 } |
| 45 | 44 |
| 46 int GeolocationInfoBarDelegateAndroid::GetIconId() const { | 45 int GeolocationInfoBarDelegateAndroid::GetIconId() const { |
| 47 return IDR_ANDROID_INFOBAR_GEOLOCATION; | 46 return IDR_ANDROID_INFOBAR_GEOLOCATION; |
| 48 } | 47 } |
| 49 | 48 |
| 50 int GeolocationInfoBarDelegateAndroid::GetMessageResourceId() const { | 49 int GeolocationInfoBarDelegateAndroid::GetMessageResourceId() const { |
| 51 return IDS_GEOLOCATION_INFOBAR_QUESTION; | 50 return IDS_GEOLOCATION_INFOBAR_QUESTION; |
| 52 } | 51 } |
| OLD | NEW |