| 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 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" | 5 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/android/google_location_settings_helper.h" | 9 #include "chrome/browser/android/google_location_settings_helper.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 GEOLOCATION_INFO_BAR_DELEGATE_ANDROID_EVENT_COUNT = 2 | 28 GEOLOCATION_INFO_BAR_DELEGATE_ANDROID_EVENT_COUNT = 2 |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 void RecordUmaEvent(GeolocationInfoBarDelegateAndroidEvent event) { | 31 void RecordUmaEvent(GeolocationInfoBarDelegateAndroidEvent event) { |
| 32 UMA_HISTOGRAM_ENUMERATION("Geolocation.InfoBarDelegateAndroid.Event", | 32 UMA_HISTOGRAM_ENUMERATION("Geolocation.InfoBarDelegateAndroid.Event", |
| 33 event, GEOLOCATION_INFO_BAR_DELEGATE_ANDROID_EVENT_COUNT); | 33 event, GEOLOCATION_INFO_BAR_DELEGATE_ANDROID_EVENT_COUNT); |
| 34 } | 34 } |
| 35 } // namespace | 35 } // namespace |
| 36 | 36 |
| 37 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( | 37 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( |
| 38 InfoBarService* infobar_service, | |
| 39 PermissionQueueController* controller, | 38 PermissionQueueController* controller, |
| 40 const PermissionRequestID& id, | 39 const PermissionRequestID& id, |
| 41 const GURL& requesting_frame_url, | 40 const GURL& requesting_frame_url, |
| 42 int contents_unique_id, | 41 int contents_unique_id, |
| 43 const std::string& display_languages) | 42 const std::string& display_languages) |
| 44 : GeolocationInfoBarDelegate(infobar_service, controller, id, | 43 : GeolocationInfoBarDelegate(controller, id, requesting_frame_url, |
| 45 requesting_frame_url, contents_unique_id, | 44 contents_unique_id, display_languages), |
| 46 display_languages), | |
| 47 google_location_settings_helper_( | 45 google_location_settings_helper_( |
| 48 GoogleLocationSettingsHelper::Create()) { | 46 GoogleLocationSettingsHelper::Create()) { |
| 49 } | 47 } |
| 50 | 48 |
| 51 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() { | 49 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() { |
| 52 } | 50 } |
| 53 | 51 |
| 54 bool GeolocationInfoBarDelegateAndroid::Accept() { | 52 bool GeolocationInfoBarDelegateAndroid::Accept() { |
| 55 set_user_has_interacted(); | 53 set_user_has_interacted(); |
| 56 | 54 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 68 SetPermission(false, false); | 66 SetPermission(false, false); |
| 69 return true; | 67 return true; |
| 70 } | 68 } |
| 71 | 69 |
| 72 string16 GeolocationInfoBarDelegateAndroid::GetButtonLabel( | 70 string16 GeolocationInfoBarDelegateAndroid::GetButtonLabel( |
| 73 InfoBarButton button) const { | 71 InfoBarButton button) const { |
| 74 return (button == BUTTON_OK) ? | 72 return (button == BUTTON_OK) ? |
| 75 UTF8ToUTF16(google_location_settings_helper_->GetAcceptButtonLabel()) : | 73 UTF8ToUTF16(google_location_settings_helper_->GetAcceptButtonLabel()) : |
| 76 l10n_util::GetStringUTF16(IDS_GEOLOCATION_DENY_BUTTON); | 74 l10n_util::GetStringUTF16(IDS_GEOLOCATION_DENY_BUTTON); |
| 77 } | 75 } |
| OLD | NEW |