Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 93883004: Sync the launch type pref for apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test for invalid value, make tests actually check things Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4321 matching lines...) Expand 10 before | Expand all | Expand 10 after
4332 } else if (launch_type_str == "fullscreen") { 4332 } else if (launch_type_str == "fullscreen") {
4333 launch_type = extensions::LAUNCH_TYPE_FULLSCREEN; 4333 launch_type = extensions::LAUNCH_TYPE_FULLSCREEN;
4334 } else if (launch_type_str == "window") { 4334 } else if (launch_type_str == "window") {
4335 launch_type = extensions::LAUNCH_TYPE_WINDOW; 4335 launch_type = extensions::LAUNCH_TYPE_WINDOW;
4336 } else { 4336 } else {
4337 reply.SendError(base::StringPrintf( 4337 reply.SendError(base::StringPrintf(
4338 "Unexpected launch type '%s'.", launch_type_str.c_str())); 4338 "Unexpected launch type '%s'.", launch_type_str.c_str()));
4339 return; 4339 return;
4340 } 4340 }
4341 4341
4342 extensions::SetLaunchType( 4342 extensions::SetLaunchType(service, extension->id(), launch_type);
4343 service->extension_prefs(), extension->id(), launch_type);
4344 reply.SendSuccess(NULL); 4343 reply.SendSuccess(NULL);
4345 } 4344 }
4346 4345
4347 // Sample json input: { "command": "GetV8HeapStats", 4346 // Sample json input: { "command": "GetV8HeapStats",
4348 // "tab_index": 0 } 4347 // "tab_index": 0 }
4349 // Refer to GetV8HeapStats() in chrome/test/pyautolib/pyauto.py for 4348 // Refer to GetV8HeapStats() in chrome/test/pyautolib/pyauto.py for
4350 // sample json output. 4349 // sample json output.
4351 void TestingAutomationProvider::GetV8HeapStats( 4350 void TestingAutomationProvider::GetV8HeapStats(
4352 Browser* browser, 4351 Browser* browser,
4353 DictionaryValue* args, 4352 DictionaryValue* args,
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
5458 if (g_browser_process) 5457 if (g_browser_process)
5459 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 5458 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
5460 } 5459 }
5461 5460
5462 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 5461 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
5463 WebContents* tab) { 5462 WebContents* tab) {
5464 TabStripModel* tab_strip = browser->tab_strip_model(); 5463 TabStripModel* tab_strip = browser->tab_strip_model();
5465 if (tab_strip->GetActiveWebContents() != tab) 5464 if (tab_strip->GetActiveWebContents() != tab)
5466 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 5465 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
5467 } 5466 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698