Chromium Code Reviews| 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.h" | 5 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/content_settings/permission_queue_controller.h" | 8 #include "chrome/browser/content_settings/permission_queue_controller.h" |
| 9 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 99 |
| 100 bool GeolocationInfoBarDelegate::Accept() { | 100 bool GeolocationInfoBarDelegate::Accept() { |
| 101 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_ALLOW); | 101 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_ALLOW); |
| 102 set_user_has_interacted(); | 102 set_user_has_interacted(); |
| 103 SetPermission(true, true); | 103 SetPermission(true, true); |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting, | 107 void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting, |
| 108 bool allowed) { | 108 bool allowed) { |
| 109 if (web_contents()) { | 109 controller_->OnPermissionSet(id_, requesting_frame_, |
| 110 GURL embedder = web_contents()->GetLastCommittedURL().GetOrigin(); | 110 web_contents()->GetURL(), update_content_setting, allowed); |
|
Peter Kasting
2013/11/04 22:14:19
Nit: All lines of args should begin at the same in
Michael van Ouwerkerk
2013/11/05 11:49:06
Peter is right, these changes are incorrect. Pleas
Miguel Garcia
2013/11/05 14:17:56
Thanks for the pointer, I removed the straight git
| |
| 111 controller_->OnPermissionSet(id_, requesting_frame_, embedder, | |
| 112 update_content_setting, allowed); | |
| 113 } | |
| 114 } | 111 } |
| 115 | 112 |
| 116 void GeolocationInfoBarDelegate::InfoBarDismissed() { | 113 void GeolocationInfoBarDelegate::InfoBarDismissed() { |
| 117 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_DISMISS); | 114 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_DISMISS); |
| 118 set_user_has_interacted(); | 115 set_user_has_interacted(); |
| 119 SetPermission(false, false); | 116 SetPermission(false, false); |
| 120 } | 117 } |
| 121 | 118 |
| 122 int GeolocationInfoBarDelegate::GetIconID() const { | 119 int GeolocationInfoBarDelegate::GetIconID() const { |
| 123 return IDR_GEOLOCATION_INFOBAR_ICON; | 120 return IDR_GEOLOCATION_INFOBAR_ICON; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 "https://www.google.com/support/chrome/bin/answer.py?answer=142065"; | 169 "https://www.google.com/support/chrome/bin/answer.py?answer=142065"; |
| 173 #endif | 170 #endif |
| 174 | 171 |
| 175 web_contents()->OpenURL(content::OpenURLParams( | 172 web_contents()->OpenURL(content::OpenURLParams( |
| 176 google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)), | 173 google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)), |
| 177 content::Referrer(), | 174 content::Referrer(), |
| 178 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 175 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 179 content::PAGE_TRANSITION_LINK, false)); | 176 content::PAGE_TRANSITION_LINK, false)); |
| 180 return false; // Do not dismiss the info bar. | 177 return false; // Do not dismiss the info bar. |
| 181 } | 178 } |
| OLD | NEW |