| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/test/chromedriver/chrome_launcher.h" | 5 #include "chrome/test/chromedriver/chrome_launcher.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 | 775 |
| 776 if (include_automation_extension) { | 776 if (include_automation_extension) { |
| 777 base::FilePath automation_extension; | 777 base::FilePath automation_extension; |
| 778 Status status = UnpackAutomationExtension(temp_dir, &automation_extension); | 778 Status status = UnpackAutomationExtension(temp_dir, &automation_extension); |
| 779 if (status.IsError()) | 779 if (status.IsError()) |
| 780 return status; | 780 return status; |
| 781 #if defined(OS_WIN) || defined(OS_MACOSX) | 781 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 782 // On Chrome for Windows and Mac, a "Disable developer mode extensions" | 782 // On Chrome for Windows and Mac, a "Disable developer mode extensions" |
| 783 // dialog appears for the automation extension. Suppress this by loading | 783 // dialog appears for the automation extension. Suppress this by loading |
| 784 // it as a component extension. | 784 // it as a component extension. |
| 785 UpdateExtensionSwitch(switches, "load-component-extension", | 785 UpdateExtensionSwitch(switches, "disable-extensions-except", |
| 786 automation_extension.value()); | 786 automation_extension.value()); |
| 787 #else | 787 #else |
| 788 if (switches->HasSwitch("disable-extensions")) { | 788 if (switches->HasSwitch("disable-extensions")) { |
| 789 UpdateExtensionSwitch(switches, "load-component-extension", | 789 UpdateExtensionSwitch(switches, "disable-extensions-except", |
| 790 automation_extension.value()); | 790 automation_extension.value()); |
| 791 } else { | 791 } else { |
| 792 extension_paths.push_back(automation_extension.value()); | 792 extension_paths.push_back(automation_extension.value()); |
| 793 } | 793 } |
| 794 #endif | 794 #endif |
| 795 } | 795 } |
| 796 | 796 |
| 797 if (extension_paths.size()) { | 797 if (extension_paths.size()) { |
| 798 base::FilePath::StringType extension_paths_value = base::JoinString( | 798 base::FilePath::StringType extension_paths_value = base::JoinString( |
| 799 extension_paths, base::FilePath::StringType(1, ',')); | 799 extension_paths, base::FilePath::StringType(1, ',')); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 // Write empty "First Run" file, otherwise Chrome will wipe the default | 879 // Write empty "First Run" file, otherwise Chrome will wipe the default |
| 880 // profile that was written. | 880 // profile that was written. |
| 881 if (base::WriteFile( | 881 if (base::WriteFile( |
| 882 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { | 882 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { |
| 883 return Status(kUnknownError, "failed to write first run file"); | 883 return Status(kUnknownError, "failed to write first run file"); |
| 884 } | 884 } |
| 885 return Status(kOk); | 885 return Status(kOk); |
| 886 } | 886 } |
| 887 | 887 |
| 888 } // namespace internal | 888 } // namespace internal |
| OLD | NEW |