browser_linux.cc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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/libgtk2ui/unity_service.h"
  11. namespace atom {
  12. void Browser::Focus() {
  13. // Focus on the first visible window.
  14. WindowList* list = WindowList::GetInstance();
  15. for (WindowList::iterator iter = list->begin(); iter != list->end(); ++iter) {
  16. NativeWindow* window = *iter;
  17. if (window->IsVisible()) {
  18. window->Focus(true);
  19. break;
  20. }
  21. }
  22. }
  23. void Browser::AddRecentDocument(const base::FilePath& path) {
  24. }
  25. void Browser::ClearRecentDocuments() {
  26. }
  27. void Browser::SetAppUserModelID(const base::string16& name) {
  28. }
  29. bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
  30. mate::Arguments* args) {
  31. return false;
  32. }
  33. bool Browser::SetAsDefaultProtocolClient(const std::string& protocol,
  34. mate::Arguments* args) {
  35. return false;
  36. }
  37. bool Browser::IsDefaultProtocolClient(const std::string& protocol,
  38. mate::Arguments* args) {
  39. return false;
  40. }
  41. bool Browser::SetBadgeCount(int count) {
  42. if (IsUnityRunning()) {
  43. unity::SetDownloadCount(count);
  44. badge_count_ = count;
  45. return true;
  46. } else {
  47. return false;
  48. }
  49. }
  50. void Browser::SetLoginItemSettings(LoginItemSettings settings) {
  51. }
  52. Browser::LoginItemSettings Browser::GetLoginItemSettings() {
  53. return LoginItemSettings();
  54. }
  55. std::string Browser::GetExecutableFileVersion() const {
  56. return brightray::GetApplicationVersion();
  57. }
  58. std::string Browser::GetExecutableFileProductName() const {
  59. return brightray::GetApplicationName();
  60. }
  61. bool Browser::IsUnityRunning() {
  62. return unity::IsRunning();
  63. }
  64. } // namespace atom