| 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 5711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5722 WebContents* old_contents = chrome::GetActiveWebContents(browser); | 5722 WebContents* old_contents = chrome::GetActiveWebContents(browser); |
| 5723 if (!old_contents) { | 5723 if (!old_contents) { |
| 5724 AutomationJSONReply(this, reply_message).SendError( | 5724 AutomationJSONReply(this, reply_message).SendError( |
| 5725 "Cannot identify selected tab contents."); | 5725 "Cannot identify selected tab contents."); |
| 5726 return; | 5726 return; |
| 5727 } | 5727 } |
| 5728 | 5728 |
| 5729 // This observer will delete itself. | 5729 // This observer will delete itself. |
| 5730 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, | 5730 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, |
| 5731 launch_container); | 5731 launch_container); |
| 5732 application_launch::OpenApplication(profile(), extension, launch_container, | 5732 application_launch::OpenApplication(application_launch::LaunchParams( |
| 5733 GURL(), CURRENT_TAB, NULL); | 5733 profile(), extension, launch_container, CURRENT_TAB)); |
| 5734 } | 5734 } |
| 5735 | 5735 |
| 5736 // Sample JSON input: { "command": "SetAppLaunchType", | 5736 // Sample JSON input: { "command": "SetAppLaunchType", |
| 5737 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", | 5737 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", |
| 5738 // "launch_type": "pinned" } | 5738 // "launch_type": "pinned" } |
| 5739 // Sample JSON output: {} | 5739 // Sample JSON output: {} |
| 5740 void TestingAutomationProvider::SetAppLaunchType( | 5740 void TestingAutomationProvider::SetAppLaunchType( |
| 5741 Browser* browser, | 5741 Browser* browser, |
| 5742 DictionaryValue* args, | 5742 DictionaryValue* args, |
| 5743 IPC::Message* reply_message) { | 5743 IPC::Message* reply_message) { |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6750 void TestingAutomationProvider::OnRemoveProvider() { | 6750 void TestingAutomationProvider::OnRemoveProvider() { |
| 6751 if (g_browser_process) | 6751 if (g_browser_process) |
| 6752 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6752 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6753 } | 6753 } |
| 6754 | 6754 |
| 6755 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6755 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6756 WebContents* tab) { | 6756 WebContents* tab) { |
| 6757 if (chrome::GetActiveWebContents(browser) != tab) | 6757 if (chrome::GetActiveWebContents(browser) != tab) |
| 6758 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 6758 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
| 6759 } | 6759 } |
| OLD | NEW |