| 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 6097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6108 if (!old_contents) { | 6108 if (!old_contents) { |
| 6109 AutomationJSONReply(this, reply_message).SendError( | 6109 AutomationJSONReply(this, reply_message).SendError( |
| 6110 "Cannot identify selected tab contents."); | 6110 "Cannot identify selected tab contents."); |
| 6111 return; | 6111 return; |
| 6112 } | 6112 } |
| 6113 | 6113 |
| 6114 // This observer will delete itself. | 6114 // This observer will delete itself. |
| 6115 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, | 6115 new AppLaunchObserver(&old_contents->GetController(), this, reply_message, |
| 6116 launch_container); | 6116 launch_container); |
| 6117 Browser::OpenApplication(profile(), extension, launch_container, GURL(), | 6117 Browser::OpenApplication(profile(), extension, launch_container, GURL(), |
| 6118 CURRENT_TAB); | 6118 CURRENT_TAB, NULL); |
| 6119 } | 6119 } |
| 6120 | 6120 |
| 6121 // Sample JSON input: { "command": "SetAppLaunchType", | 6121 // Sample JSON input: { "command": "SetAppLaunchType", |
| 6122 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", | 6122 // "id": "ahfgeienlihckogmohjhadlkjgocpleb", |
| 6123 // "launch_type": "pinned" } | 6123 // "launch_type": "pinned" } |
| 6124 // Sample JSON output: {} | 6124 // Sample JSON output: {} |
| 6125 void TestingAutomationProvider::SetAppLaunchType( | 6125 void TestingAutomationProvider::SetAppLaunchType( |
| 6126 Browser* browser, | 6126 Browser* browser, |
| 6127 DictionaryValue* args, | 6127 DictionaryValue* args, |
| 6128 IPC::Message* reply_message) { | 6128 IPC::Message* reply_message) { |
| (...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7158 *browser_handle = browser_tracker_->Add(browser); | 7158 *browser_handle = browser_tracker_->Add(browser); |
| 7159 *success = true; | 7159 *success = true; |
| 7160 } | 7160 } |
| 7161 } | 7161 } |
| 7162 } | 7162 } |
| 7163 | 7163 |
| 7164 void TestingAutomationProvider::OnRemoveProvider() { | 7164 void TestingAutomationProvider::OnRemoveProvider() { |
| 7165 if (g_browser_process) | 7165 if (g_browser_process) |
| 7166 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 7166 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 7167 } | 7167 } |
| OLD | NEW |