2014-10-31 18:17:05 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 09:49:37 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2014-01-02 14:47:54 +00:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-03-16 00:30:26 +00:00
|
|
|
#include "atom/browser/browser.h"
|
2014-01-02 14:47:54 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2014-03-16 00:30:26 +00:00
|
|
|
#include "atom/browser/native_window.h"
|
|
|
|
#include "atom/browser/window_list.h"
|
|
|
|
#include "atom/common/atom_version.h"
|
2015-04-14 07:55:41 +00:00
|
|
|
#include "brightray/common/application_info.h"
|
2016-06-25 23:55:24 +00:00
|
|
|
#include "chrome/browser/ui/libgtk2ui/unity_service.h"
|
2014-01-02 14:47:54 +00:00
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
void Browser::Focus() {
|
|
|
|
// Focus on the first visible window.
|
|
|
|
WindowList* list = WindowList::GetInstance();
|
|
|
|
for (WindowList::iterator iter = list->begin(); iter != list->end(); ++iter) {
|
|
|
|
NativeWindow* window = *iter;
|
|
|
|
if (window->IsVisible()) {
|
|
|
|
window->Focus(true);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-17 05:05:06 +00:00
|
|
|
void Browser::AddRecentDocument(const base::FilePath& path) {
|
|
|
|
}
|
|
|
|
|
2014-11-17 08:13:47 +00:00
|
|
|
void Browser::ClearRecentDocuments() {
|
|
|
|
}
|
|
|
|
|
2015-11-03 07:09:31 +00:00
|
|
|
void Browser::SetAppUserModelID(const base::string16& name) {
|
|
|
|
}
|
|
|
|
|
2016-03-24 17:55:09 +00:00
|
|
|
bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-03-21 18:24:25 +00:00
|
|
|
bool Browser::SetAsDefaultProtocolClient(const std::string& protocol) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-04-25 05:17:01 +00:00
|
|
|
bool Browser::IsDefaultProtocolClient(const std::string& protocol) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-07-01 13:18:39 +00:00
|
|
|
bool Browser::SetBadgeCount(int count) {
|
|
|
|
if (IsUnityRunning()) {
|
|
|
|
unity::SetDownloadCount(count);
|
2016-07-02 01:36:11 +00:00
|
|
|
badge_count_ = count;
|
2016-07-01 13:18:39 +00:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2016-07-01 08:39:01 +00:00
|
|
|
}
|
|
|
|
|
2014-01-02 14:47:54 +00:00
|
|
|
std::string Browser::GetExecutableFileVersion() const {
|
2015-04-14 07:55:41 +00:00
|
|
|
return brightray::GetApplicationVersion();
|
2014-01-02 14:47:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string Browser::GetExecutableFileProductName() const {
|
2015-04-14 07:55:41 +00:00
|
|
|
return brightray::GetApplicationName();
|
2014-01-02 14:47:54 +00:00
|
|
|
}
|
|
|
|
|
2016-07-01 08:39:01 +00:00
|
|
|
bool Browser::IsUnityRunning() {
|
2016-06-25 23:55:24 +00:00
|
|
|
return unity::IsRunning();
|
|
|
|
}
|
|
|
|
|
2014-01-02 14:47:54 +00:00
|
|
|
} // namespace atom
|