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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 #include "chrome/browser/translate/translate_tab_helper.h" | 95 #include "chrome/browser/translate/translate_tab_helper.h" |
96 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 96 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
97 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 97 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
98 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 98 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
99 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 99 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
100 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 100 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
101 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 101 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
102 #include "chrome/browser/ui/browser_finder.h" | 102 #include "chrome/browser/ui/browser_finder.h" |
103 #include "chrome/browser/ui/browser_list.h" | 103 #include "chrome/browser/ui/browser_list.h" |
104 #include "chrome/browser/ui/browser_window.h" | 104 #include "chrome/browser/ui/browser_window.h" |
| 105 #include "chrome/browser/ui/extensions/application_launch.h" |
105 #include "chrome/browser/ui/find_bar/find_bar.h" | 106 #include "chrome/browser/ui/find_bar/find_bar.h" |
106 #include "chrome/browser/ui/fullscreen_controller.h" | 107 #include "chrome/browser/ui/fullscreen_controller.h" |
107 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 108 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
108 #include "chrome/browser/ui/login/login_prompt.h" | 109 #include "chrome/browser/ui/login/login_prompt.h" |
109 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 110 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
110 #include "chrome/browser/ui/omnibox/location_bar.h" | 111 #include "chrome/browser/ui/omnibox/location_bar.h" |
111 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 112 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
112 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 113 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
113 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 114 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
114 #include "chrome/common/automation_id.h" | 115 #include "chrome/common/automation_id.h" |
(...skipping 5471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5586 WebContents* old_contents = browser->GetSelectedWebContents(); | 5587 WebContents* old_contents = browser->GetSelectedWebContents(); |
5587 if (!old_contents) { | 5588 if (!old_contents) { |
5588 AutomationJSONReply(this, reply_message).SendError( | 5589 AutomationJSONReply(this, reply_message).SendError( |
5589 "Cannot identify selected tab contents."); | 5590 "Cannot identify selected tab contents."); |
5590 return; | 5591 return; |
5591 } | 5592 } |
5592 | 5593 |
5593 // This observer will delete itself. | 5594 // This observer will delete itself. |
5594 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, | 5595 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, |
5595 launch_container); | 5596 launch_container); |
5596 Browser::OpenApplication(profile(), extension, launch_container, GURL(), | 5597 application_launch::OpenApplication(profile(), extension, launch_container, |
5597 CURRENT_TAB); | 5598 GURL(), CURRENT_TAB); |
5598 } | 5599 } |
5599 | 5600 |
5600 // Sample JSON input: { "command": "SetAppLaunchType", | 5601 // Sample JSON input: { "command": "SetAppLaunchType", |
5601 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", | 5602 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", |
5602 // "launch_type": "pinned" } | 5603 // "launch_type": "pinned" } |
5603 // Sample JSON output: {} | 5604 // Sample JSON output: {} |
5604 void TestingAutomationProvider::SetAppLaunchType( | 5605 void TestingAutomationProvider::SetAppLaunchType( |
5605 Browser* browser, | 5606 Browser* browser, |
5606 DictionaryValue* args, | 5607 DictionaryValue* args, |
5607 IPC::Message* reply_message) { | 5608 IPC::Message* reply_message) { |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6570 | 6571 |
6571 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( | 6572 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( |
6572 IPC::Message* reply_message) { | 6573 IPC::Message* reply_message) { |
6573 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); | 6574 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); |
6574 } | 6575 } |
6575 | 6576 |
6576 void TestingAutomationProvider::OnRemoveProvider() { | 6577 void TestingAutomationProvider::OnRemoveProvider() { |
6577 if (g_browser_process) | 6578 if (g_browser_process) |
6578 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6579 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6579 } | 6580 } |
OLD | NEW |