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

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

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/browser_focus_uitest.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 (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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 } 1187 }
1188 return_value->Set("profiles", profiles); 1188 return_value->Set("profiles", profiles);
1189 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); 1189 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get());
1190 } 1190 }
1191 1191
1192 void TestingAutomationProvider::OpenNewBrowserWindowOfType( 1192 void TestingAutomationProvider::OpenNewBrowserWindowOfType(
1193 int type, bool show, IPC::Message* reply_message) { 1193 int type, bool show, IPC::Message* reply_message) {
1194 new BrowserOpenedNotificationObserver(this, reply_message, false); 1194 new BrowserOpenedNotificationObserver(this, reply_message, false);
1195 // We may have no current browser windows open so don't rely on 1195 // We may have no current browser windows open so don't rely on
1196 // asking an existing browser to execute the IDC_NEWWINDOW command 1196 // asking an existing browser to execute the IDC_NEWWINDOW command
1197 Browser* browser = new Browser(static_cast<Browser::Type>(type), profile_); 1197 Browser* browser = new Browser(
1198 browser->InitBrowserWindow(); 1198 Browser::CreateParams(static_cast<Browser::Type>(type), profile_));
1199 chrome::AddBlankTab(browser, true); 1199 chrome::AddBlankTab(browser, true);
1200 if (show) 1200 if (show)
1201 browser->window()->Show(); 1201 browser->window()->Show();
1202 } 1202 }
1203 1203
1204 void TestingAutomationProvider::OpenProfileWindow( 1204 void TestingAutomationProvider::OpenProfileWindow(
1205 base::DictionaryValue* args, IPC::Message* reply_message) { 1205 base::DictionaryValue* args, IPC::Message* reply_message) {
1206 ProfileManager* profile_manager = g_browser_process->profile_manager(); 1206 ProfileManager* profile_manager = g_browser_process->profile_manager();
1207 FilePath::StringType path; 1207 FilePath::StringType path;
1208 if (!args->GetString("path", &path)) { 1208 if (!args->GetString("path", &path)) {
(...skipping 5750 matching lines...) Expand 10 before | Expand all | Expand 10 after
6959 void TestingAutomationProvider::OnRemoveProvider() { 6959 void TestingAutomationProvider::OnRemoveProvider() {
6960 if (g_browser_process) 6960 if (g_browser_process)
6961 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6961 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6962 } 6962 }
6963 6963
6964 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 6964 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
6965 WebContents* tab) { 6965 WebContents* tab) {
6966 if (chrome::GetActiveWebContents(browser) != tab) 6966 if (chrome::GetActiveWebContents(browser) != tab)
6967 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); 6967 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true);
6968 } 6968 }
OLDNEW
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698