Update for reviews

This commit is contained in:
Cheng Zhao 2016-07-02 10:36:11 +09:00
parent b47d0e3e58
commit 767124c45c
5 changed files with 6 additions and 6 deletions

View file

@ -119,7 +119,7 @@ void Browser::SetName(const std::string& name) {
}
int Browser::GetBadgeCount() {
return current_badge_count_;
return badge_count_;
}
bool Browser::OpenFile(const std::string& file_path) {

View file

@ -225,7 +225,7 @@ class Browser : public WindowListObserver {
std::string version_override_;
std::string name_override_;
int current_badge_count_ = 0;
int badge_count_ = 0;
#if defined(OS_WIN)
base::string16 app_user_model_id_;

View file

@ -50,7 +50,7 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol) {
bool Browser::SetBadgeCount(int count) {
if (IsUnityRunning()) {
unity::SetDownloadCount(count);
current_badge_count_ = count;
badge_count_ = count;
return true;
} else {
return false;

View file

@ -11,8 +11,8 @@
#include "atom/browser/window_list.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "brightray/common/application_info.h"
#include "net/base/mac/url_conversions.h"
#include "url/gurl.h"
@ -117,7 +117,7 @@ void Browser::SetAppUserModelID(const base::string16& name) {
bool Browser::SetBadgeCount(int count) {
DockSetBadgeText(count != 0 ? base::IntToString(count) : "");
current_badge_count_ = count;
badge_count_ = count;
return true;
}

View file

@ -287,7 +287,7 @@ describe('app module', function () {
describe('app.setBadgeCount API', function () {
const shouldFail = process.platform === 'win32' ||
(process.platform === 'linux' && app.isUnityRunning())
(process.platform === 'linux' && !app.isUnityRunning())
it('returns false when failed', function () {
assert.equal(app.setBadgeCount(42), !shouldFail)