| 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 | 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> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #include "chrome/browser/translate/translate_tab_helper.h" | 94 #include "chrome/browser/translate/translate_tab_helper.h" |
| 95 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 95 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
| 96 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 96 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
| 97 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 97 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
| 98 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 98 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
| 99 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 99 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
| 100 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 100 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 101 #include "chrome/browser/ui/browser_finder.h" | 101 #include "chrome/browser/ui/browser_finder.h" |
| 102 #include "chrome/browser/ui/browser_list.h" | 102 #include "chrome/browser/ui/browser_list.h" |
| 103 #include "chrome/browser/ui/browser_window.h" | 103 #include "chrome/browser/ui/browser_window.h" |
| 104 #include "chrome/browser/ui/extensions/application_launch.h" |
| 104 #include "chrome/browser/ui/find_bar/find_bar.h" | 105 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 105 #include "chrome/browser/ui/fullscreen_controller.h" | 106 #include "chrome/browser/ui/fullscreen_controller.h" |
| 106 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 107 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
| 107 #include "chrome/browser/ui/login/login_prompt.h" | 108 #include "chrome/browser/ui/login/login_prompt.h" |
| 108 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 109 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
| 109 #include "chrome/browser/ui/omnibox/location_bar.h" | 110 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 110 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 111 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 111 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 112 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
| 112 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 113 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 113 #include "chrome/common/automation_id.h" | 114 #include "chrome/common/automation_id.h" |
| (...skipping 5463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5577 WebContents* old_contents = browser->GetSelectedWebContents(); | 5578 WebContents* old_contents = browser->GetSelectedWebContents(); |
| 5578 if (!old_contents) { | 5579 if (!old_contents) { |
| 5579 AutomationJSONReply(this, reply_message).SendError( | 5580 AutomationJSONReply(this, reply_message).SendError( |
| 5580 "Cannot identify selected tab contents."); | 5581 "Cannot identify selected tab contents."); |
| 5581 return; | 5582 return; |
| 5582 } | 5583 } |
| 5583 | 5584 |
| 5584 // This observer will delete itself. | 5585 // This observer will delete itself. |
| 5585 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, | 5586 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, |
| 5586 launch_container); | 5587 launch_container); |
| 5587 Browser::OpenApplication(profile(), extension, launch_container, GURL(), | 5588 ApplicationLaunch::OpenApplication(profile(), extension, launch_container, |
| 5588 CURRENT_TAB); | 5589 GURL(), CURRENT_TAB); |
| 5589 } | 5590 } |
| 5590 | 5591 |
| 5591 // Sample JSON input: { "command": "SetAppLaunchType", | 5592 // Sample JSON input: { "command": "SetAppLaunchType", |
| 5592 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", | 5593 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", |
| 5593 // "launch_type": "pinned" } | 5594 // "launch_type": "pinned" } |
| 5594 // Sample JSON output: {} | 5595 // Sample JSON output: {} |
| 5595 void TestingAutomationProvider::SetAppLaunchType( | 5596 void TestingAutomationProvider::SetAppLaunchType( |
| 5596 Browser* browser, | 5597 Browser* browser, |
| 5597 DictionaryValue* args, | 5598 DictionaryValue* args, |
| 5598 IPC::Message* reply_message) { | 5599 IPC::Message* reply_message) { |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6550 | 6551 |
| 6551 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( | 6552 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( |
| 6552 IPC::Message* reply_message) { | 6553 IPC::Message* reply_message) { |
| 6553 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); | 6554 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); |
| 6554 } | 6555 } |
| 6555 | 6556 |
| 6556 void TestingAutomationProvider::OnRemoveProvider() { | 6557 void TestingAutomationProvider::OnRemoveProvider() { |
| 6557 if (g_browser_process) | 6558 if (g_browser_process) |
| 6558 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6559 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6559 } | 6560 } |
| OLD | NEW |