OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser/automation/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/message_box_flags.h" | 10 #include "app/message_box_flags.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #include "chrome/browser/renderer_host/render_process_host.h" | 76 #include "chrome/browser/renderer_host/render_process_host.h" |
77 #include "chrome/browser/renderer_host/render_view_host.h" | 77 #include "chrome/browser/renderer_host/render_view_host.h" |
78 #include "chrome/browser/ssl/ssl_manager.h" | 78 #include "chrome/browser/ssl/ssl_manager.h" |
79 #include "chrome/browser/ssl/ssl_blocking_page.h" | 79 #include "chrome/browser/ssl/ssl_blocking_page.h" |
80 #include "chrome/browser/tab_contents/infobar_delegate.h" | 80 #include "chrome/browser/tab_contents/infobar_delegate.h" |
81 #include "chrome/browser/tab_contents/tab_contents.h" | 81 #include "chrome/browser/tab_contents/tab_contents.h" |
82 #include "chrome/browser/tab_contents/tab_contents_view.h" | 82 #include "chrome/browser/tab_contents/tab_contents_view.h" |
83 #include "chrome/common/automation_constants.h" | 83 #include "chrome/common/automation_constants.h" |
84 #include "chrome/common/chrome_constants.h" | 84 #include "chrome/common/chrome_constants.h" |
85 #include "chrome/common/chrome_paths.h" | 85 #include "chrome/common/chrome_paths.h" |
| 86 #include "chrome/common/chrome_switches.h" |
86 #include "chrome/common/extensions/extension.h" | 87 #include "chrome/common/extensions/extension.h" |
87 #include "chrome/common/json_value_serializer.h" | 88 #include "chrome/common/json_value_serializer.h" |
88 #include "chrome/common/net/url_request_context_getter.h" | 89 #include "chrome/common/net/url_request_context_getter.h" |
89 #include "chrome/common/notification_service.h" | 90 #include "chrome/common/notification_service.h" |
90 #include "chrome/common/pref_names.h" | 91 #include "chrome/common/pref_names.h" |
91 #include "chrome/common/url_constants.h" | 92 #include "chrome/common/url_constants.h" |
92 #include "chrome/test/automation/automation_messages.h" | 93 #include "chrome/test/automation/automation_messages.h" |
93 #include "chrome/test/automation/tab_proxy.h" | 94 #include "chrome/test/automation/tab_proxy.h" |
94 #include "net/proxy/proxy_service.h" | 95 #include "net/proxy/proxy_service.h" |
95 #include "net/proxy/proxy_config_service_fixed.h" | 96 #include "net/proxy/proxy_config_service_fixed.h" |
(...skipping 3238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3334 | 3335 |
3335 void TestingAutomationProvider::OnChannelError() { | 3336 void TestingAutomationProvider::OnChannelError() { |
3336 BrowserList::CloseAllBrowsersAndExit(); | 3337 BrowserList::CloseAllBrowsersAndExit(); |
3337 AutomationProvider::OnChannelError(); | 3338 AutomationProvider::OnChannelError(); |
3338 } | 3339 } |
3339 | 3340 |
3340 void TestingAutomationProvider::OnBrowserRemoving(const Browser* browser) { | 3341 void TestingAutomationProvider::OnBrowserRemoving(const Browser* browser) { |
3341 // For backwards compatibility with the testing automation interface, we | 3342 // For backwards compatibility with the testing automation interface, we |
3342 // want the automation provider (and hence the process) to go away when the | 3343 // want the automation provider (and hence the process) to go away when the |
3343 // last browser goes away. | 3344 // last browser goes away. |
3344 if (BrowserList::size() == 1) { | 3345 if (BrowserList::size() == 1 && !CommandLine::ForCurrentProcess()->HasSwitch( |
| 3346 switches::kKeepAliveForTest)) { |
3345 // If you change this, update Observer for NotificationType::SESSION_END | 3347 // If you change this, update Observer for NotificationType::SESSION_END |
3346 // below. | 3348 // below. |
3347 MessageLoop::current()->PostTask(FROM_HERE, | 3349 MessageLoop::current()->PostTask(FROM_HERE, |
3348 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); | 3350 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); |
3349 } | 3351 } |
3350 } | 3352 } |
3351 | 3353 |
3352 void TestingAutomationProvider::Observe(NotificationType type, | 3354 void TestingAutomationProvider::Observe(NotificationType type, |
3353 const NotificationSource& source, | 3355 const NotificationSource& source, |
3354 const NotificationDetails& details) { | 3356 const NotificationDetails& details) { |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4033 } | 4035 } |
4034 | 4036 |
4035 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) { | 4037 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) { |
4036 NOTIMPLEMENTED(); | 4038 NOTIMPLEMENTED(); |
4037 } | 4039 } |
4038 #endif // !defined(TOOLKIT_VIEWS) | 4040 #endif // !defined(TOOLKIT_VIEWS) |
4039 | 4041 |
4040 void AutomationProvider::ResetToDefaultTheme() { | 4042 void AutomationProvider::ResetToDefaultTheme() { |
4041 profile_->ClearTheme(); | 4043 profile_->ClearTheme(); |
4042 } | 4044 } |
OLD | NEW |