forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[notification scheduler]: GetClientOverview public API.
- Change public service API getImpressionDetail to getClientOverview. - New API returns a struct ClientOverview including info about notifications in the scheduler also ImpressionDetails. - The glue layer wrapped result queried from ImpressionTracker and result queried from ScheduledNotificationManager to ClientOverview struct. Bug: 1025387 Change-Id: Iab6bad5be5e914730645975af86293c2b6395810 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918651 Reviewed-by: David Trainor <dtrainor@chromium.org> Reviewed-by: Xing Liu <xingliu@chromium.org> Commit-Queue: Hesen Zhang <hesen@chromium.org> Auto-Submit: Hesen Zhang <hesen@chromium.org> Cr-Commit-Position: refs/heads/master@{#716862}
- Loading branch information
Hesen Zhang
authored and
Commit Bot
committed
Nov 20, 2019
1 parent
ea86225
commit 0b109bb
Showing
14 changed files
with
115 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
chrome/browser/notifications/scheduler/public/client_overview.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/notifications/scheduler/public/client_overview.h" | ||
|
||
#include <utility> | ||
|
||
namespace notifications { | ||
|
||
ClientOverview::ClientOverview() : num_scheduled_notifications(0) {} | ||
|
||
ClientOverview::ClientOverview(ImpressionDetail impression_detail, | ||
int num_scheduled_notifications) | ||
: impression_detail(std::move(impression_detail)), | ||
num_scheduled_notifications(num_scheduled_notifications) {} | ||
|
||
ClientOverview::ClientOverview(const ClientOverview& other) = default; | ||
|
||
ClientOverview::~ClientOverview() = default; | ||
|
||
bool ClientOverview::operator==(const ClientOverview& other) const { | ||
return num_scheduled_notifications == other.num_scheduled_notifications && | ||
impression_detail == other.impression_detail; | ||
} | ||
|
||
} // namespace notifications |
33 changes: 33 additions & 0 deletions
33
chrome/browser/notifications/scheduler/public/client_overview.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_PUBLIC_CLIENT_OVERVIEW_H_ | ||
#define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_PUBLIC_CLIENT_OVERVIEW_H_ | ||
|
||
#include "base/callback.h" | ||
|
||
#include "chrome/browser/notifications/scheduler/public/impression_detail.h" | ||
|
||
namespace notifications { | ||
|
||
struct ClientOverview { | ||
using ClientOverviewCallback = base::OnceCallback<void(ClientOverview)>; | ||
|
||
ClientOverview(); | ||
ClientOverview(ImpressionDetail impression_detail, | ||
int num_scheduled_notifications); | ||
ClientOverview(const ClientOverview& other); | ||
~ClientOverview(); | ||
bool operator==(const ClientOverview& other) const; | ||
|
||
// Details of impression. | ||
ImpressionDetail impression_detail; | ||
|
||
// The number of notifications cached in scheduler but not displayed yet. | ||
int num_scheduled_notifications; | ||
}; | ||
|
||
} // namespace notifications | ||
|
||
#endif // CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_PUBLIC_CLIENT_OVERVIEW_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters