Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 | 4 |
| 5 #include "chrome/browser/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/json/json_reader.h" | 16 #include "base/json/json_reader.h" |
| 17 #include "base/json/json_writer.h" | 17 #include "base/json/json_writer.h" |
| 18 #include "base/json/string_escape.h" | 18 #include "base/json/string_escape.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/process.h" | 20 #include "base/process.h" |
| 21 #include "base/process_util.h" | 21 #include "base/process_util.h" |
| 22 #include "base/sequenced_task_runner.h" | 22 #include "base/sequenced_task_runner.h" |
| 23 #include "base/stringprintf.h" | 23 #include "base/stringprintf.h" |
| 24 #include "base/threading/thread_restrictions.h" | 24 #include "base/threading/thread_restrictions.h" |
| 25 #include "base/time.h" | 25 #include "base/time.h" |
| 26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
| 27 #include "chrome/app/chrome_command_ids.h" | 27 #include "chrome/app/chrome_command_ids.h" |
| 28 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 28 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 29 #include "chrome/browser/api/infobars/infobar_service.h" | 29 #include "chrome/browser/api/infobars/infobar_service.h" |
| 30 #include "chrome/browser/api/infobars/link_infobar_delegate.h" | |
| 31 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 30 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 32 #include "chrome/browser/autocomplete/autocomplete_match.h" | 31 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 33 #include "chrome/browser/autocomplete/autocomplete_result.h" | 32 #include "chrome/browser/autocomplete/autocomplete_result.h" |
| 34 #include "chrome/browser/automation/automation_browser_tracker.h" | 33 #include "chrome/browser/automation/automation_browser_tracker.h" |
| 35 #include "chrome/browser/automation/automation_provider_json.h" | 34 #include "chrome/browser/automation/automation_provider_json.h" |
| 36 #include "chrome/browser/automation/automation_provider_list.h" | 35 #include "chrome/browser/automation/automation_provider_list.h" |
| 37 #include "chrome/browser/automation/automation_provider_observers.h" | 36 #include "chrome/browser/automation/automation_provider_observers.h" |
| 38 #include "chrome/browser/automation/automation_tab_tracker.h" | 37 #include "chrome/browser/automation/automation_tab_tracker.h" |
| 39 #include "chrome/browser/automation/automation_util.h" | 38 #include "chrome/browser/automation/automation_util.h" |
| 40 #include "chrome/browser/automation/automation_window_tracker.h" | 39 #include "chrome/browser/automation/automation_window_tracker.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 58 #include "chrome/browser/extensions/extension_process_manager.h" | 57 #include "chrome/browser/extensions/extension_process_manager.h" |
| 59 #include "chrome/browser/extensions/extension_service.h" | 58 #include "chrome/browser/extensions/extension_service.h" |
| 60 #include "chrome/browser/extensions/extension_system.h" | 59 #include "chrome/browser/extensions/extension_system.h" |
| 61 #include "chrome/browser/extensions/extension_tab_util.h" | 60 #include "chrome/browser/extensions/extension_tab_util.h" |
| 62 #include "chrome/browser/extensions/unpacked_installer.h" | 61 #include "chrome/browser/extensions/unpacked_installer.h" |
| 63 #include "chrome/browser/extensions/updater/extension_updater.h" | 62 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 64 #include "chrome/browser/history/history_service_factory.h" | 63 #include "chrome/browser/history/history_service_factory.h" |
| 65 #include "chrome/browser/history/top_sites.h" | 64 #include "chrome/browser/history/top_sites.h" |
| 66 #include "chrome/browser/importer/importer_host.h" | 65 #include "chrome/browser/importer/importer_host.h" |
| 67 #include "chrome/browser/importer/importer_list.h" | 66 #include "chrome/browser/importer/importer_list.h" |
| 67 #include "chrome/browser/infobars/alternate_nav_infobar_delegate.h" | |
| 68 #include "chrome/browser/lifetime/application_lifetime.h" | 68 #include "chrome/browser/lifetime/application_lifetime.h" |
| 69 #include "chrome/browser/notifications/balloon.h" | 69 #include "chrome/browser/notifications/balloon.h" |
| 70 #include "chrome/browser/notifications/balloon_collection.h" | 70 #include "chrome/browser/notifications/balloon_collection.h" |
| 71 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" | 71 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" |
| 72 #include "chrome/browser/notifications/notification.h" | 72 #include "chrome/browser/notifications/notification.h" |
| 73 #include "chrome/browser/password_manager/password_store.h" | 73 #include "chrome/browser/password_manager/password_store.h" |
| 74 #include "chrome/browser/password_manager/password_store_change.h" | 74 #include "chrome/browser/password_manager/password_store_change.h" |
| 75 #include "chrome/browser/password_manager/password_store_factory.h" | 75 #include "chrome/browser/password_manager/password_store_factory.h" |
| 76 #include "chrome/browser/platform_util.h" | 76 #include "chrome/browser/platform_util.h" |
| 77 #include "chrome/browser/plugins/plugin_prefs.h" | 77 #include "chrome/browser/plugins/plugin_prefs.h" |
| (...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2156 ConfirmInfoBarDelegate::BUTTON_OK)); | 2156 ConfirmInfoBarDelegate::BUTTON_OK)); |
| 2157 buttons_list->Append(button_label); | 2157 buttons_list->Append(button_label); |
| 2158 } | 2158 } |
| 2159 if (buttons & ConfirmInfoBarDelegate::BUTTON_CANCEL) { | 2159 if (buttons & ConfirmInfoBarDelegate::BUTTON_CANCEL) { |
| 2160 StringValue* button_label = new StringValue( | 2160 StringValue* button_label = new StringValue( |
| 2161 confirm_infobar->GetButtonLabel( | 2161 confirm_infobar->GetButtonLabel( |
| 2162 ConfirmInfoBarDelegate::BUTTON_CANCEL)); | 2162 ConfirmInfoBarDelegate::BUTTON_CANCEL)); |
| 2163 buttons_list->Append(button_label); | 2163 buttons_list->Append(button_label); |
| 2164 } | 2164 } |
| 2165 infobar_item->Set("buttons", buttons_list); | 2165 infobar_item->Set("buttons", buttons_list); |
| 2166 } else if (infobar->AsLinkInfoBarDelegate()) { | 2166 } else if (infobar->AsAlternateNavInfoBarDelegate()) { |
|
Peter Kasting
2013/01/04 01:09:07
Who actually cares about the values this is settin
| |
| 2167 infobar_item->SetString("type", "link_infobar"); | 2167 infobar_item->SetString("type", "alternate_nav_infobar"); |
| 2168 LinkInfoBarDelegate* link_infobar = infobar->AsLinkInfoBarDelegate(); | 2168 AlternateNavInfoBarDelegate* alternate_nav_infobar = |
| 2169 infobar_item->SetString("link_text", link_infobar->GetLinkText()); | 2169 infobar->AsAlternateNavInfoBarDelegate(); |
| 2170 infobar_item->SetString("link_text", | |
| 2171 alternate_nav_infobar->GetLinkText()); | |
| 2170 } else if (infobar->AsExtensionInfoBarDelegate()) { | 2172 } else if (infobar->AsExtensionInfoBarDelegate()) { |
| 2171 infobar_item->SetString("type", "extension_infobar"); | 2173 infobar_item->SetString("type", "extension_infobar"); |
| 2172 } else { | 2174 } else { |
| 2173 infobar_item->SetString("type", "unknown_infobar"); | 2175 infobar_item->SetString("type", "unknown_infobar"); |
| 2174 } | 2176 } |
| 2175 infobars->Append(infobar_item); | 2177 infobars->Append(infobar_item); |
| 2176 } | 2178 } |
| 2177 return infobars; | 2179 return infobars; |
| 2178 } | 2180 } |
| 2179 | 2181 |
| (...skipping 4096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6276 if (g_browser_process) | 6278 if (g_browser_process) |
| 6277 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6279 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6278 } | 6280 } |
| 6279 | 6281 |
| 6280 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6282 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6281 WebContents* tab) { | 6283 WebContents* tab) { |
| 6282 TabStripModel* tab_strip = browser->tab_strip_model(); | 6284 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 6283 if (tab_strip->GetActiveWebContents() != tab) | 6285 if (tab_strip->GetActiveWebContents() != tab) |
| 6284 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 6286 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
| 6285 } | 6287 } |
| OLD | NEW |