OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 4319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4330 } else if (launch_type_str == "fullscreen") { | 4330 } else if (launch_type_str == "fullscreen") { |
4331 launch_type = extensions::LAUNCH_TYPE_FULLSCREEN; | 4331 launch_type = extensions::LAUNCH_TYPE_FULLSCREEN; |
4332 } else if (launch_type_str == "window") { | 4332 } else if (launch_type_str == "window") { |
4333 launch_type = extensions::LAUNCH_TYPE_WINDOW; | 4333 launch_type = extensions::LAUNCH_TYPE_WINDOW; |
4334 } else { | 4334 } else { |
4335 reply.SendError(base::StringPrintf( | 4335 reply.SendError(base::StringPrintf( |
4336 "Unexpected launch type '%s'.", launch_type_str.c_str())); | 4336 "Unexpected launch type '%s'.", launch_type_str.c_str())); |
4337 return; | 4337 return; |
4338 } | 4338 } |
4339 | 4339 |
4340 extensions::SetLaunchType( | 4340 extensions::SetLaunchType(service, extension->id(), launch_type); |
4341 service->extension_prefs(), extension->id(), launch_type); | |
4342 reply.SendSuccess(NULL); | 4341 reply.SendSuccess(NULL); |
4343 } | 4342 } |
4344 | 4343 |
4345 // Sample json input: { "command": "GetV8HeapStats", | 4344 // Sample json input: { "command": "GetV8HeapStats", |
4346 // "tab_index": 0 } | 4345 // "tab_index": 0 } |
4347 // Refer to GetV8HeapStats() in chrome/test/pyautolib/pyauto.py for | 4346 // Refer to GetV8HeapStats() in chrome/test/pyautolib/pyauto.py for |
4348 // sample json output. | 4347 // sample json output. |
4349 void TestingAutomationProvider::GetV8HeapStats( | 4348 void TestingAutomationProvider::GetV8HeapStats( |
4350 Browser* browser, | 4349 Browser* browser, |
4351 DictionaryValue* args, | 4350 DictionaryValue* args, |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5456 if (g_browser_process) | 5455 if (g_browser_process) |
5457 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5456 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
5458 } | 5457 } |
5459 | 5458 |
5460 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5459 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
5461 WebContents* tab) { | 5460 WebContents* tab) { |
5462 TabStripModel* tab_strip = browser->tab_strip_model(); | 5461 TabStripModel* tab_strip = browser->tab_strip_model(); |
5463 if (tab_strip->GetActiveWebContents() != tab) | 5462 if (tab_strip->GetActiveWebContents() != tab) |
5464 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5463 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
5465 } | 5464 } |
OLD | NEW |