| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 """Finds desktop browsers that can be controlled by telemetry.""" | 4 """Finds desktop browsers that can be controlled by telemetry.""" |
| 5 | 5 |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 super(PossibleDesktopBrowser, self).__init__(browser_type, options) | 29 super(PossibleDesktopBrowser, self).__init__(browser_type, options) |
| 30 self._local_executable = executable | 30 self._local_executable = executable |
| 31 self._is_content_shell = is_content_shell | 31 self._is_content_shell = is_content_shell |
| 32 | 32 |
| 33 def __repr__(self): | 33 def __repr__(self): |
| 34 return 'PossibleDesktopBrowser(browser_type=%s)' % self.browser_type | 34 return 'PossibleDesktopBrowser(browser_type=%s)' % self.browser_type |
| 35 | 35 |
| 36 def Create(self): | 36 def Create(self): |
| 37 backend = desktop_browser_backend.DesktopBrowserBackend( | 37 backend = desktop_browser_backend.DesktopBrowserBackend( |
| 38 self._options, self._local_executable, self._is_content_shell) | 38 self._options, self._local_executable, self._is_content_shell) |
| 39 b = browser.Browser(backend, platform.Platform()) | 39 b = browser.Browser(backend, platform.EmptyPlatform()) |
| 40 backend.SetBrowser(b) | 40 backend.SetBrowser(b) |
| 41 return b | 41 return b |
| 42 | 42 |
| 43 def SupportsOptions(self, options): | 43 def SupportsOptions(self, options): |
| 44 if (len(options.extensions_to_load) != 0) and self._is_content_shell: | 44 if (len(options.extensions_to_load) != 0) and self._is_content_shell: |
| 45 return False | 45 return False |
| 46 return True | 46 return True |
| 47 | 47 |
| 48 def FindAllAvailableBrowsers(options): | 48 def FindAllAvailableBrowsers(options): |
| 49 """Finds all the desktop browsers available on this machine.""" | 49 """Finds all the desktop browsers available on this machine.""" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 chromium_app_name, False): | 153 chromium_app_name, False): |
| 154 break | 154 break |
| 155 | 155 |
| 156 if len(browsers) and not has_display: | 156 if len(browsers) and not has_display: |
| 157 logging.warning( | 157 logging.warning( |
| 158 'Found (%s), but you do not have a DISPLAY environment set.' % | 158 'Found (%s), but you do not have a DISPLAY environment set.' % |
| 159 ','.join([b.browser_type for b in browsers])) | 159 ','.join([b.browser_type for b in browsers])) |
| 160 return [] | 160 return [] |
| 161 | 161 |
| 162 return browsers | 162 return browsers |
| OLD | NEW |