| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/android/search_geolocation_disclosure_tab_helper.h" | 5 #include "chrome/browser/android/search_geolocation_disclosure_tab_helper.h" |
| 6 | 6 |
| 7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/android/search_geolocation_disclosure_infobar_delegate.
h" | 9 #include "chrome/browser/android/search_geolocation_disclosure_infobar_delegate.
h" |
| 10 #include "chrome/browser/permissions/permission_manager.h" | 10 #include "chrome/browser/permissions/permission_manager.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // Only show the disclosure if the geolocation permission is set to ASK | 64 // Only show the disclosure if the geolocation permission is set to ASK |
| 65 // (i.e. has not been explicitly set or revoked). | 65 // (i.e. has not been explicitly set or revoked). |
| 66 blink::mojom::PermissionStatus status = | 66 blink::mojom::PermissionStatus status = |
| 67 PermissionManager::Get(GetProfile()) | 67 PermissionManager::Get(GetProfile()) |
| 68 ->GetPermissionStatus(content::PermissionType::GEOLOCATION, gurl, | 68 ->GetPermissionStatus(content::PermissionType::GEOLOCATION, gurl, |
| 69 gurl); | 69 gurl); |
| 70 if (status != blink::mojom::PermissionStatus::ASK) | 70 if (status != blink::mojom::PermissionStatus::ASK) |
| 71 return; | 71 return; |
| 72 | 72 |
| 73 // All good, let's show the disclosure. | 73 // All good, let's show the disclosure. |
| 74 SearchGeolocationDisclosureInfoBarDelegate::Create(web_contents()); | 74 SearchGeolocationDisclosureInfoBarDelegate::Create(web_contents(), gurl); |
| 75 } | 75 } |
| 76 | 76 |
| 77 Profile* SearchGeolocationDisclosureTabHelper::GetProfile() { | 77 Profile* SearchGeolocationDisclosureTabHelper::GetProfile() { |
| 78 return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 78 return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 79 } | 79 } |
| OLD | NEW |