Commit 42f867a1 authored by tby's avatar tby Committed by Commit Bot

[Suggested files] Use correct ItemSuggest request.

This replaces the placeholder request with one that correctly
identifies ourselves, uses the right scenario, and limits the
response details.

Two notes:

- There's no need for us to control any part of this request via
  Finch, because we can change what model the scenario maps to on the
  backend.

- I've increased the number of requested results to 10, in case some
  are unavailable at display time.

Bug: 1034842
Change-Id: Ibf37b912e0a2f115ba2bdb13c866b25e24e6e620
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2434007Reviewed-by: default avatarRachel Wong <wrong@chromium.org>
Commit-Queue: Tony Yeoman <tby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811098}
parent e0dbd441
......@@ -64,16 +64,14 @@ constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
// The scope required for an access token in order to query ItemSuggest.
constexpr char kDriveScope[] = "https://www.googleapis.com/auth/drive.readonly";
// TODO(crbug.com/1034842): Check this is correct. Also consider:
// - controlling at least the scenario type by experiment param.
// - whether we can filter the response to certain fields
constexpr char kRequestBody[] = R"({
'max_suggestions': 5,
'client_info': {
'platform_type': 'CHROMEOS',
'application_type': 'GOOGLE_DRIVE',
'scenario_type': 'QUICK_ACCESS'
}})";
'platform_type': 'CHROME_OS',
'scenario_type': 'CHROME_OS_ZSS_FILES'
},
'max_suggestions': 10,
'type_detail_fields': []
})";
bool IsDisabledByPolicy(const Profile* profile) {
return profile->GetPrefs()->GetBoolean(drive::prefs::kDisableDrive);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment