app.setBadgeCount should return boolean
This commit is contained in:
parent
f8ec377123
commit
1da2a1c2ae
6 changed files with 24 additions and 11 deletions
|
@ -88,7 +88,7 @@ class Browser : public WindowListObserver {
|
|||
bool IsDefaultProtocolClient(const std::string& protocol);
|
||||
|
||||
// Set/Get the badge count.
|
||||
void SetBadgeCount(int count);
|
||||
bool SetBadgeCount(int count);
|
||||
int GetBadgeCount();
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
|
|
|
@ -47,9 +47,14 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void Browser::SetBadgeCount(int count) {
|
||||
current_badge_count_ = count;
|
||||
unity::SetDownloadCount(count);
|
||||
bool Browser::SetBadgeCount(int count) {
|
||||
if (IsUnityRunning()) {
|
||||
unity::SetDownloadCount(count);
|
||||
current_badge_count_ = count;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Browser::GetExecutableFileVersion() const {
|
||||
|
|
|
@ -115,9 +115,10 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol) {
|
|||
void Browser::SetAppUserModelID(const base::string16& name) {
|
||||
}
|
||||
|
||||
void Browser::SetBadgeCount(int count) {
|
||||
bool Browser::SetBadgeCount(int count) {
|
||||
DockSetBadgeText(count != 0 ? base::IntToString(count) : "");
|
||||
current_badge_count_ = count;
|
||||
DockSetBadgeText(count == 0 ? base::IntToString(count) : "");
|
||||
return true;
|
||||
}
|
||||
|
||||
void Browser::SetUserActivity(const std::string& type,
|
||||
|
|
|
@ -269,8 +269,8 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol) {
|
|||
}
|
||||
}
|
||||
|
||||
void Browser::SetBadgeCount(int count) {
|
||||
current_badge_count_ = count;
|
||||
bool Browser::SetBadgeCount(int count) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PCWSTR Browser::GetAppUserModelID() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue