Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/android/search_geolocation_disclosure_tab_helper.cc

Issue 2482023002: Put a Settings link on the new Google Search geolocation disclosure. (Closed)
Patch Set: Update comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698