Miscellaneous permissions cleanup.
This patch:
* Introduces a new method PermissionRequest::IsDuplicateOf, rather than
relying on comparing the result of GetMessageTextFragment (which
returns a human-readable string) to determine whether two requests are
duplicates.
* Makes PermissionRequest::GetMessageTextFragment desktop-only, as it
was only used elsewhere in the aforementioned duplicates logic.
* Uses std::u16string in MockPermissionRequest everywhere.
* And deletes a few bits of unused code.
Bug: 1110905
Change-Id: I39704d74d9456674a30c9483ed10423c84e998f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2778492
Commit-Queue: Bret Sepulveda <[email protected]>
Reviewed-by: Xiaohan Wang <[email protected]>
Reviewed-by: Xing Liu <[email protected]>
Reviewed-by: Dana Fried <[email protected]>
Reviewed-by: Ben Wells <[email protected]>
Reviewed-by: Olesia Marukhno <[email protected]>
Reviewed-by: Kamila Hasanbega <[email protected]>
Reviewed-by: Ravjit Singh Uppal <[email protected]>
Cr-Commit-Position: refs/heads/master@{#874233}
diff --git a/components/permissions/permission_request.h b/components/permissions/permission_request.h
index 65523f9..54f0fb4b 100644
--- a/components/permissions/permission_request.h
+++ b/components/permissions/permission_request.h
@@ -33,31 +33,25 @@
// The type of this request.
virtual RequestType GetRequestType() const = 0;
+ // Whether |this| and |other_request| are duplicates and therefore don't both
+ // need to be shown in the UI.
+ virtual bool IsDuplicateOf(PermissionRequest* other_request) const;
+
#if defined(OS_ANDROID)
// Returns the full prompt text for this permission. This is currently only
// used on Android.
virtual std::u16string GetMessageText() const = 0;
-
- // Returns the title of this permission as text when the permission request is
- // displayed as a quiet prompt. Only used on Android. By default it returns
- // the same value as |GetTitleText| unless overridden.
- virtual std::u16string GetQuietTitleText() const;
-
- // Returns the full prompt text for this permission as text when the
- // permission request is displayed as a quiet prompt. Only used on Android. By
- // default it returns the same value as |GetMessageText| unless overridden.
- virtual std::u16string GetQuietMessageText() const;
#endif
#if !defined(OS_ANDROID)
// Returns the short text for the chip button related to this permission.
virtual base::Optional<std::u16string> GetChipText() const;
-#endif
// Returns the shortened prompt text for this permission. The permission
// bubble may coalesce different requests, and if it does, this text will
// be displayed next to an image and indicate the user grants the permission.
virtual std::u16string GetMessageTextFragment() const = 0;
+#endif
// Get the origin on whose behalf this permission request is being made.
virtual GURL GetOrigin() const = 0;