| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 | 4 |
| 5 """Quits Chrome. | 5 """Quits Chrome. |
| 6 | 6 |
| 7 This script sends a WM_CLOSE message to each window of Chrome and waits until | 7 This script sends a WM_CLOSE message to each window of Chrome and waits until |
| 8 the process terminates. | 8 the process terminates. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 usage = 'usage: %prog chrome_path' | 64 usage = 'usage: %prog chrome_path' |
| 65 parser = optparse.OptionParser(usage, description='Quit Chrome.') | 65 parser = optparse.OptionParser(usage, description='Quit Chrome.') |
| 66 _, args = parser.parse_args() | 66 _, args = parser.parse_args() |
| 67 if len(args) != 1: | 67 if len(args) != 1: |
| 68 parser.error('Incorrect number of arguments.') | 68 parser.error('Incorrect number of arguments.') |
| 69 chrome_path = args[0] | 69 chrome_path = args[0] |
| 70 | 70 |
| 71 if not CloseWindows(chrome_path): | 71 if not CloseWindows(chrome_path): |
| 72 # TODO(robertshield): Investigate why Chrome occasionally doesn't shut down. | 72 # TODO(robertshield): Investigate why Chrome occasionally doesn't shut down. |
| 73 print 'Warning: Chrome not responding to window closure. Killing process...' | 73 print 'Warning: Chrome not responding to window closure. Killing process...' |
| 74 KillNamedProcess(chrome_path): | 74 KillNamedProcess(chrome_path) |
| 75 return 0 | 75 return 0 |
| 76 | 76 |
| 77 | 77 |
| 78 if __name__ == '__main__': | 78 if __name__ == '__main__': |
| 79 sys.exit(main()) | 79 sys.exit(main()) |
| OLD | NEW |