browser_linux.cc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Copyright (c) 2013 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "atom/browser/browser.h"
  5. #include <stdlib.h>
  6. #include "atom/browser/native_window.h"
  7. #include "atom/browser/window_list.h"
  8. #include "atom/common/atom_version.h"
  9. #include "brightray/common/application_info.h"
  10. #include "chrome/browser/ui/libgtkui/unity_service.h"
  11. namespace atom {
  12. void Browser::Focus() {
  13. // Focus on the first visible window.
  14. for (const auto& window : WindowList::GetWindows()) {
  15. if (window->IsVisible()) {
  16. window->Focus(true);
  17. break;
  18. }
  19. }
  20. }
  21. void Browser::AddRecentDocument(const base::FilePath& path) {
  22. }
  23. void Browser::ClearRecentDocuments() {
  24. }
  25. void Browser::SetAppUserModelID(const base::string16& name) {
  26. }
  27. bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
  28. mate::Arguments* args) {
  29. return false;
  30. }
  31. bool Browser::SetAsDefaultProtocolClient(const std::string& protocol,
  32. mate::Arguments* args) {
  33. return false;
  34. }
  35. bool Browser::IsDefaultProtocolClient(const std::string& protocol,
  36. mate::Arguments* args) {
  37. return false;
  38. }
  39. bool Browser::SetBadgeCount(int count) {
  40. if (IsUnityRunning()) {
  41. unity::SetDownloadCount(count);
  42. badge_count_ = count;
  43. return true;
  44. } else {
  45. return false;
  46. }
  47. }
  48. void Browser::SetLoginItemSettings(LoginItemSettings settings) {
  49. }
  50. Browser::LoginItemSettings Browser::GetLoginItemSettings(
  51. const LoginItemSettings& options) {
  52. return LoginItemSettings();
  53. }
  54. std::string Browser::GetExecutableFileVersion() const {
  55. return brightray::GetApplicationVersion();
  56. }
  57. std::string Browser::GetExecutableFileProductName() const {
  58. return brightray::GetApplicationName();
  59. }
  60. bool Browser::IsUnityRunning() {
  61. return unity::IsRunning();
  62. }
  63. } // namespace atom