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

Side by Side Diff: chrome/browser/geolocation/geolocation_infobar_delegate_android.cc

Issue 2154033003: Add gesture type value from infobar to permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-user-gesture-from-permission-layer-to-permission-report
Patch Set: nit Created 4 years, 4 months 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 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 Profile* profile, 18 Profile* profile,
18 const PermissionSetCallback& callback) { 19 const PermissionSetCallback& callback) {
19 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( 20 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
20 std::unique_ptr<ConfirmInfoBarDelegate>( 21 std::unique_ptr<ConfirmInfoBarDelegate>(
21 new GeolocationInfoBarDelegateAndroid(requesting_frame, profile, 22 new GeolocationInfoBarDelegateAndroid(requesting_frame, user_gesture,
22 callback)))); 23 profile, callback))));
23 } 24 }
24 25
25 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( 26 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid(
26 const GURL& requesting_frame, 27 const GURL& requesting_frame,
28 bool user_gesture,
27 Profile* profile, 29 Profile* profile,
28 const PermissionSetCallback& callback) 30 const PermissionSetCallback& callback)
29 : PermissionInfobarDelegate(requesting_frame, 31 : PermissionInfobarDelegate(requesting_frame,
30 content::PermissionType::GEOLOCATION, 32 content::PermissionType::GEOLOCATION,
31 CONTENT_SETTINGS_TYPE_GEOLOCATION, 33 CONTENT_SETTINGS_TYPE_GEOLOCATION,
34 user_gesture,
32 profile, 35 profile,
33 callback), 36 callback),
34 requesting_frame_(requesting_frame) {} 37 requesting_frame_(requesting_frame) {}
35 38
36 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() {} 39 GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() {}
37 40
38 infobars::InfoBarDelegate::InfoBarIdentifier 41 infobars::InfoBarDelegate::InfoBarIdentifier
39 GeolocationInfoBarDelegateAndroid::GetIdentifier() const { 42 GeolocationInfoBarDelegateAndroid::GetIdentifier() const {
40 return GEOLOCATION_INFOBAR_DELEGATE_ANDROID; 43 return GEOLOCATION_INFOBAR_DELEGATE_ANDROID;
41 } 44 }
42 45
43 int GeolocationInfoBarDelegateAndroid::GetIconId() const { 46 int GeolocationInfoBarDelegateAndroid::GetIconId() const {
44 return IDR_ANDROID_INFOBAR_GEOLOCATION; 47 return IDR_ANDROID_INFOBAR_GEOLOCATION;
45 } 48 }
46 49
47 int GeolocationInfoBarDelegateAndroid::GetMessageResourceId() const { 50 int GeolocationInfoBarDelegateAndroid::GetMessageResourceId() const {
48 return IDS_GEOLOCATION_INFOBAR_QUESTION; 51 return IDS_GEOLOCATION_INFOBAR_QUESTION;
49 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698