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

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: unfix nit because it prevents testing of how invalid values are handled 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/management/management_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4328 matching lines...) Expand 10 before | Expand all | Expand 10 after
4339 } else if (launch_type_str == "fullscreen") { 4339 } else if (launch_type_str == "fullscreen") {
4340 launch_type = extensions::LAUNCH_TYPE_FULLSCREEN; 4340 launch_type = extensions::LAUNCH_TYPE_FULLSCREEN;
4341 } else if (launch_type_str == "window") { 4341 } else if (launch_type_str == "window") {
4342 launch_type = extensions::LAUNCH_TYPE_WINDOW; 4342 launch_type = extensions::LAUNCH_TYPE_WINDOW;
4343 } else { 4343 } else {
4344 reply.SendError(base::StringPrintf( 4344 reply.SendError(base::StringPrintf(
4345 "Unexpected launch type '%s'.", launch_type_str.c_str())); 4345 "Unexpected launch type '%s'.", launch_type_str.c_str()));
4346 return; 4346 return;
4347 } 4347 }
4348 4348
4349 extensions::SetLaunchType( 4349 extensions::SetLaunchType(service, extension->id(), launch_type);
4350 service->extension_prefs(), extension->id(), launch_type);
4351 reply.SendSuccess(NULL); 4350 reply.SendSuccess(NULL);
4352 } 4351 }
4353 4352
4354 // Sample json input: { "command": "GetV8HeapStats", 4353 // Sample json input: { "command": "GetV8HeapStats",
4355 // "tab_index": 0 } 4354 // "tab_index": 0 }
4356 // Refer to GetV8HeapStats() in chrome/test/pyautolib/pyauto.py for 4355 // Refer to GetV8HeapStats() in chrome/test/pyautolib/pyauto.py for
4357 // sample json output. 4356 // sample json output.
4358 void TestingAutomationProvider::GetV8HeapStats( 4357 void TestingAutomationProvider::GetV8HeapStats(
4359 Browser* browser, 4358 Browser* browser,
4360 base::DictionaryValue* args, 4359 base::DictionaryValue* args,
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
5465 if (g_browser_process) 5464 if (g_browser_process)
5466 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 5465 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
5467 } 5466 }
5468 5467
5469 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 5468 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
5470 WebContents* tab) { 5469 WebContents* tab) {
5471 TabStripModel* tab_strip = browser->tab_strip_model(); 5470 TabStripModel* tab_strip = browser->tab_strip_model();
5472 if (tab_strip->GetActiveWebContents() != tab) 5471 if (tab_strip->GetActiveWebContents() != tab)
5473 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 5472 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
5474 } 5473 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/management/management_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698